Thanks, Dmitriy and Rekha . So I understand the flatten on bag explodes to
multiple rows now.
The BagConcat seems to work. Actually, doing a simple example using the
group by, it would appear that the bag contains the results in the order
that they were before entering the group by. (so, if I group after an order
by x desc, then when I dump the table it prints the bag, but contents are
reversed)... So, actually, for my purposes, not having results in order is
what about instead of charsplit, the data I have is this:
and I want to explode it into
(sorry, I made a mistake in the original question, the string is not a
string but a tuple.) I think I may be able to get it into:
but still, I need to explode it into several rows to operate on them
On Sun, Feb 21, 2010 at 8:03 PM, Rekha Joshi wrote:
You would require a udf for this.Please check if you already have an
existing one in latest pig-udf.jar.
Or since this is a pretty simple one , you can write one yourself - take
the tuple, assess the type , append the strings and return it from your
On 2/19/10 11:51 PM, "hc busy" wrote:
Guys, I know this must be a common use case, but how do you explode and
implode in pig?
so, I have a file like this...
and I want to apply an explode operation to it:
and after some work... I have this file:
and I want to perform an implode:
well, obviously this is a dumb example, but I'd like to do those things.
somebody help me with this? I looked in the piggy bank and didn't see
anything that would do this for me.