I did something like this to count the number of rows in an alias in PIG:
logs = LOAD \'log\' logs_w_one = foreach logs generate 1 as one; logs_group = group
Arnon Rotem-Gal-Oz already answered this question a while ago, but I thought some may like this slightly more concise version.
LOGS = LOAD 'log'; LOG_COUNT = FOREACH (GROUP LOGS ALL) GENERATE COUNT(LOGS);