Grokbase Groups Pig user March 2011
FAQ
Sorry if butcher the terminology I'm still new to Pig but Ill try my best.
Given a bag of tuples how can I create a flattened version of all the
tuples?
For example say I have {(1), (2), (3)} how can I produce? (1,2,3).

Thanks

Search Discussions

  • Xuefu Zhang at Mar 12, 2011 at 6:01 am
    You probably needs a UDF that takes a bag and produces a tuple that combines all tuples in the bag. I'm not sure if there is such a UDF in Piggybank. The flatten clause doesn't do what you want.

    Thanks,
    Xuefu

    -----Original Message-----
    From: Mark
    Sent: Friday, March 11, 2011 9:26 PM
    To: user@pig.apache.org
    Subject: Newbie question on bags/tuples

    Sorry if butcher the terminology I'm still new to Pig but Ill try my best.
    Given a bag of tuples how can I create a flattened version of all the tuples?
    For example say I have {(1), (2), (3)} how can I produce? (1,2,3).

    Thanks
  • Jonathan Coveney at Mar 12, 2011 at 6:25 am
    I thin xuefu is right. It would not be a tough thing to do however and would be a good way to begin learnijg the interfaces. You would basically just grow a list of elements and then make a tuple from it. If order matters, make an accumulator. If not, algebraic.

    Sent via BlackBerry

    -----Original Message-----
    From: Xuefu Zhang <xuefuz@yahoo-inc.com>
    Date: Fri, 11 Mar 2011 22:00:46
    To: user@pig.apache.org<user@pig.apache.org>
    Reply-To: user@pig.apache.org
    Subject: RE: Newbie question on bags/tuples

    You probably needs a UDF that takes a bag and produces a tuple that combines all tuples in the bag. I'm not sure if there is such a UDF in Piggybank. The flatten clause doesn't do what you want.

    Thanks,
    Xuefu

    -----Original Message-----
    From: Mark
    Sent: Friday, March 11, 2011 9:26 PM
    To: user@pig.apache.org
    Subject: Newbie question on bags/tuples

    Sorry if butcher the terminology I'm still new to Pig but Ill try my best.
    Given a bag of tuples how can I create a flattened version of all the tuples?
    For example say I have {(1), (2), (3)} how can I produce? (1,2,3).

    Thanks

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriespig, hadoop
postedMar 12, '11 at 5:26a
activeMar 12, '11 at 6:25a
posts3
users3
websitepig.apache.org

People

Translate

site design / logo © 2021 Grokbase