Hi,

I have this pig script.

  1 data = LOAD '$INPUT' USING PigStorage(',') AS (app:chararray,
user:chararray    , timestamp:int, duration:int);
  2
  3 appUserIn = FOREACH data GENERATE app, user;
  5 distinctAppUserIn = DISTINCT appUserIn;
  6
  7 groupOnApp = GROUP distinctAppUserIn BY app;
  8
  9 result = FOREACH groupOnApp GENERATE group, COUNT(distinctAppUserIn);
 10
 11 STORE result INTO '$OUTPUT' USING PigStorage();

I would like to add a constant to the output such a a timestamp pass into
the pig script.  So idealy I could do FOREACH groupOnApp GENERATE group,
COUNT(distinctAppUserIn), *'time_constant'*;

Is this possible in Pig?

thanks,

John

Reply via email to