Created
February 7, 2012 01:35
-
-
Save rjurney/1756481 to your computer and use it in GitHub Desktop.
Pig macro to count records in a relation
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
/* Get a count of records. */ | |
DEFINE total_count(relation) RETURNS total { | |
$total = FOREACH (group $relation all) generate $relation as label, COUNT_STAR($relation) as total; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment