apache pig - How to fetch one value from list in a column for grouped data in Pig Script -
i have data getting fetched using pig script -
generate count(c) kount, group.methodname, group.pool, min(c.time), max(c.time), c.flowid };
here flowid(alphanumeric) list multiple ids corresponding different occurrences of method names need 1 id can list. how can achieve using pig script? so, in above query how single flow id instead of list of flow ids?
any pointers appreciated..
i tried max flow id not work since flow id alphanumeric.
solved using -
e = foreach d { sorted = order c time desc; top = limit sorted 1; generate count(c) kount,flatten(top), min(c.time); };
the flatten top have latest flow id based on time
Comments
Post a Comment