Grokbase Groups Pig user June 2010
FAQ
Need to have a bunch of non related aliases into a single alias (so I can pass this alias into my UDF). Is it possible to do this? Or is it possible to pass a number of Tuple objects into an EvalFunc? exec(Tuple input1, Tuple input2, ...)

Search Discussions

  • Dmitriy Ryaboy at Jun 18, 2010 at 7:27 am
    Tuples can contain tuples.

    The arguments to a udf get wrapped in a tuple. So, MyUDF('foo', 'bar', 24)
    will invoke MyUDF.exec(Tuple input), and this input tuple will have 3 fields
    -- String foo, String bar, and int 24.

    If you call a udf on a list of tuples -- MyUDF(tuple1, tuple2) -- this will
    result in MyUDF.exec(Tuple input), with input.get(0) returning the tuple
    tuple1 and input.get(1) returning the tuple tuple2

    Hope this helps.

    -D

    On Fri, Jun 18, 2010 at 12:17 AM, Corbin Hoenes wrote:

    Need to have a bunch of non related aliases into a single alias (so I can
    pass this alias into my UDF). Is it possible to do this? Or is it possible
    to pass a number of Tuple objects into an EvalFunc? exec(Tuple input1, Tuple
    input2, ...)

  • Andrey Stepachev at Jun 18, 2010 at 7:35 am
    Another way to make tuples from other tuples or fields: use special UDF

    https://issues.apache.org/jira/browse/PIG-1385

    It depends mostly on what you need.

    2010/6/18 Corbin Hoenes <corbin@tynt.com>
    Need to have a bunch of non related aliases into a single alias (so I can
    pass this alias into my UDF). Is it possible to do this? Or is it possible
    to pass a number of Tuple objects into an EvalFunc? exec(Tuple input1, Tuple
    input2, ...)

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriespig, hadoop
postedJun 18, '10 at 7:17a
activeJun 18, '10 at 7:35a
posts3
users3
websitepig.apache.org

People

Translate

site design / logo © 2021 Grokbase