You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Eli Finkelshteyn <ie...@gmail.com> on 2012/02/16 20:48:58 UTC

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