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 >> TOBAG Function on a Tuple?


Copy link to this message
-
TOBAG Function on a Tuple?
Hi,
I was recently interested in converting a tuple to a bag. I found the
useful looking TOBAG function and figured it was perfect. Problem is,
when I pass it just a tuple, it just takes that tuple and makes a bag
with the tuple as the one item in the bag. If the tuple has a variable
number of items in it, how can I get TOBAG to put each of those items
individually in a bag ( i.e. (1,2,3) => {(1),(2),(3)} )? I know I can
just make a udf for this, but I'm feeling like there's a way to do it
with TOBAG that I'm likely missing.

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