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
USE COUNT_STAR
LOGS= LOAD 'log'; LOGS_GROUP= GROUP LOGS ALL; LOG_COUNT = FOREACH LOGS_GROUP GENERATE COUNT_STAR(LOGS);