Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Pig >> mail # user >> ordering tuple after grouping


Copy link to this message
-
ordering tuple after grouping
Given data:

(1, 55, abc)
(2, 23, asd)
(1, 85, xyz)
(1, 2, aaa)
I would like to group on $0 and then have my grouped tuple be ordered by $1. Is this possible?

The output should look like this:

(1, {(1, 2, aaa),(1,55,abc),(1,85,xyz)})
(2, {(2,23,asd)})
Then I would like to keep the first tuple for every group.

For example:

(1,2,aaa)
(2,23,asd)
+
Gianmarco De Francisci Mo... 2012-04-16, 20:43
+
Chan, Tim 2012-04-16, 23:03
+
Russell Jurney 2012-04-17, 00:22
+
Dmitriy Ryaboy 2012-04-17, 07:47
+
Gianmarco De Francisci Mo... 2012-04-17, 08:03
+
Dmitriy Ryaboy 2012-04-17, 09:50
+
Gianmarco De Francisci Mo... 2012-04-17, 10:52
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB