Created
August 12, 2011 16:29
-
-
Save jiminoc/1142411 to your computer and use it in GitHub Desktop.
import macro and calculate uniques
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Set the default number of reducers for this script | |
set default_parallel 15; | |
set job.name unique_users | |
-- INCLUDE THE OFFICIAL SCHEMA, beacons will be a relation returned | |
IMPORT 'schema.pig'; | |
beacons = grvschema('$input'); | |
fb = FOREACH beacons GENERATE userGuid; | |
distSiteUsers = DISTINCT fb; | |
grpBeacons = GROUP distSiteUsers all; | |
s = FOREACH grpBeacons GENERATE COUNT(distSiteUsers) as cnt; | |
STORE s INTO '/user/pig/$output'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment