Skip to content

Instantly share code, notes, and snippets.

@dataminelab
Created June 27, 2011 21:42
Show Gist options
  • Save dataminelab/1049918 to your computer and use it in GitHub Desktop.
Save dataminelab/1049918 to your computer and use it in GitHub Desktop.
Unique visitors HiveQL
ADD JAR ${CODE}/hive/udf/md5.jar;
CREATE TEMPORARY FUNCTION mymd5 AS 'com.dataminelab.hive.udf.Md5';
SELECT
DISTINCT mymd5(user_id)
FROM page_views
WHERE
substr(mymd5(user_id), -2) == '00';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment