Grokbase Groups Pig user April 2010
FAQ
Stupid question but are you sure your bag has the dual sets of parentheses?
(And if I may ask, why is that the case?)
On Fri, Apr 2, 2010 at 2:11 PM, zaki rahaman wrote:

If I'm not mistaken, the output is the expected behavior. Flatten should
unnest bags. I'm assuming your statement is something like FOREACH ...
GENERATE field1, field2, FLATTEN(bag1) which would 'duplicate' the first two
fields of a tuple for every tuple in the nested bag.



On Fri, Apr 2, 2010 at 2:02 PM, hc busy wrote:

doh!!!! s/map/bag/g

I seem to get maps and bags mixed up or some reason...

Guys, I have a row containing a *bag*

'id','data', {((1,2)), ((2,3)), ((4,5))}

What is the expected behavior when I flatten on that bag? I had expected
it
to result in

'id','data', (1,2)
'id','data', (2,3)
'id','data', (4,5)


But it appears to me that the result of applying FLATTEN to that bag is
this
instead:

'id','data', 1,2
'id','data', 2,3
'id','data', 4,5


The latter is returned by the current cloudera's CDH2 and I've seen the
prior behavior on other versions of pig.

Which is the correct behavior by design?

What will pig 0.6 do when it is released?

thanks!
On Fri, Apr 2, 2010 at 11:29 AM, hc busy wrote:

Guys, I have a row containing a map

'id','data', {((1,2)), ((2,3)), ((4,5))}

What is the expected behavior when I flatten on that bag? I had expected it
to result in

'id','data', (1,2)
'id','data', (2,3)
'id','data', (4,5)


But it appears to me that the result of applying FLATTEN to that bag is
this instead:

'id','data', 1,2
'id','data', 2,3
'id','data', 4,5


The latter is returned by the current cloudera's CDH2 and I've seen the
prior behavior on other versions of pig.

Which is the correct behavior by design?

What will pig 0.6 do when it is released?

thanks!


--
Zaki Rahaman

--
Zaki Rahaman

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 9 | next ›
Discussion Overview
groupuser @
categoriespig, hadoop
postedApr 2, '10 at 6:30p
activeApr 2, '10 at 10:30p
posts9
users3
websitepig.apache.org

People

Translate

site design / logo © 2021 Grokbase