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 Threaded View
Pig >> mail # user >> UNION -- Ordered


Copy link to this message
-
Re: UNION -- Ordered
As you observed, union does not guarantee the ordering . You will need to project an additional column indicating the order you want, so that you can do an order-by on it.

-Thejas

On 7/28/10 2:45 PM, "elein" <[EMAIL PROTECTED]> wrote:

I've got
A = FOREACH ...
B = FOREACH ...
C = FOREACH ...
...

X = UNION A, B, C,...

Each of the A, B, C data is a single tuple.  I want X ordered
by the order specified in the UNION.  The data in A, B, C, ... is not
necessarily in explicit sort order so ORDER X by field does not work.  I've tried breaking
the union into only unioning two pieces then that union plus another piece, etc.
That does not work either.

Anyone have any ideas how to do this
elein
[EMAIL PROTECTED]
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