Grokbase Groups Pig user May 2013
FAQ
I'd like to write a java UDF that functions more or less the same as a SQL
NVL command. I've been stymied on writing a general function by the fact
that I want it to work on all data types--in particular chararrays and
numeric types. If I extend EvalFunc<Object> then even if what I return is
a Double, Pig can't use it in a subsequent numeric calculation.

Any suggestions? Has someone already written this UDF?

Thanks,
Cat

Search Discussions

  • Ramakrishna Nalam at May 8, 2013 at 2:55 pm
    Dont know about the NVL operator in detail, but seems ternary (bincond)
    operator can fit the bill?
    http://pig.apache.org/docs/r0.10.0/basic.html#artichmetic-ops

    Regards,
    Rama.


    On Wed, May 8, 2013 at 7:45 PM, Catherine Miller wrote:

    I'd like to write a java UDF that functions more or less the same as a SQL
    NVL command. I've been stymied on writing a general function by the fact
    that I want it to work on all data types--in particular chararrays and
    numeric types. If I extend EvalFunc<Object> then even if what I return is
    a Double, Pig can't use it in a subsequent numeric calculation.

    Any suggestions? Has someone already written this UDF?

    Thanks,
    Cat

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriespig, hadoop
postedMay 8, '13 at 2:15p
activeMay 8, '13 at 2:55p
posts2
users2
websitepig.apache.org

People

Translate

site design / logo © 2021 Grokbase