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 >> Flatten a Bag on One Line?


Copy link to this message
-
Re: Flatten a Bag on One Line?
Thanks. Was hoping/assuming there was a built-in, but I guess udf it is.

Eli

On 2/9/12 2:14 PM, Yulia Tolskaya wrote:
> I actually can't think of an easy way to do this without it becoming a
> cross product. You could just right a really simple udf that takes a bag
> and spits out just the members.
>
> Yulia
>
> On 2/9/12 1:26 PM, "Eli Finkelshteyn"<[EMAIL PROTECTED]>  wrote:
>
>> This is probably easy, but my PigLatin is rusty, and I don't seem to be
>> able to find an answer on Google. If I have a record of the form:
>>
>>      98812   3       {(48567859),(15996334),(15897772)}
>>
>> How can I flatten that bag to leave all members on a single row, ie:
>>
>>      98812    3    48567859    15996334    15897772
>>
>> Cheers,
>> Eli
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