Skip to content

Instantly share code, notes, and snippets.

@nuria
Last active September 16, 2015 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nuria/c496b41759713982e34a to your computer and use it in GitHub Desktop.
Save nuria/c496b41759713982e34a to your computer and use it in GitHub Desktop.
Testing a udf
add jar /home/nuria/workplace/refinery/source/refinery-core/target/refinery-core-0.0.19-SNAPSHOT.jar;
add jar /home/nuria/workplace/refinery/source/refinery-hive/target/refinery-hive-0.0.19-SNAPSHOT.jar;
CREATE TEMPORARY FUNCTION isPageview as 'org.wikimedia.analytics.refinery.hive.IsPageviewUDF';
CREATE TEMPORARY FUNCTION isAppPageview as 'org.wikimedia.analytics.refinery.hive.IsAppPageviewUDF';
use wmf;
select isPageview(uri_host, uri_path, uri_query, http_status, content_type, user_agent) from webrequest where year=2015 and month=09 and day=04 and hour=01;
--call hive like this leaving the hive.aux.jars.path
>hive --hiveconf hive.aux.jars.path= -f test-udf.hql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment