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

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -