Reputation: 124
I'm a Java dev that have to turn off the fire on a PIG script but I'm having an annoying issue with a bag.
I got this bag of a result of a grouping:
{(GET_DIRECTIONS),(GET_DIRECTIONS)}
I only need GET_DIRECTIONS, it doesn't matter the position in the bag because my worst scenario is a bag of three elements with exactly same values (I know, we got a design problem but I cannot do a lot to solve it)
So the first thing I tried was(without reading the apache doc):
$1.state[0] as state
But it failed as there is no such thing as an index in the bag, so reading the doc I tried something like:
$1.state.$0 as state
With no failures but still getting {(GET_DIRECTIONS),(GET_DIRECTIONS)}
Is there a simple way to extract the content of the tuple in the bag?
Upvotes: 0
Views: 487