PageRenderTime 44ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.2.0-rc0/hive/external/contrib/src/test/queries/clientpositive/udaf_example_avg.q

#
text | 14 lines | 10 code | 4 blank | 0 comment | 0 complexity | aa7a449e831787dd55c7fee658803801 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  1. add jar ${system:build.dir}/hive-contrib-${system:hive.version}.jar;
  2. CREATE TEMPORARY FUNCTION example_avg AS 'org.apache.hadoop.hive.contrib.udaf.example.UDAFExampleAvg';
  3. EXPLAIN
  4. SELECT example_avg(substr(value,5)),
  5. example_avg(IF(substr(value,5) > 250, NULL, substr(value,5)))
  6. FROM src;
  7. SELECT example_avg(substr(value,5)),
  8. example_avg(IF(substr(value,5) > 250, NULL, substr(value,5)))
  9. FROM src;
  10. DROP TEMPORARY FUNCTION example_avg;