You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by chethan <ch...@gmail.com> on 2012/02/29 05:22:20 UTC

registering UDF in PIG

Hi,

If the UDF that is written not extend any of the Built-in-Functions of PIG,
but still i want to register and use it.

for example:

UDF which will do calculation particular to a work which is cannot be
extended from the built-in-functions, because of executing that function
from PIG with all that arguments is not permitting.
package name: myudf
class name: material_formation
function name: func(which will give calculation of specific to the domain)

so how to register this  UDF, whether this is permitted in PIG
If yes than how to do that.

Thanks & Regards
chethan prakash

Re: registering UDF in PIG

Posted by Dmitriy Ryaboy <dv...@gmail.com>.
A UDF should always extend EvalFunc and implement the eval method.
Then you just register the jar that contains your UDF, and call the
UDF as appropriate.
You may find this wiki page helpful: http://wiki.apache.org/pig/UDFManual

D

On Tue, Feb 28, 2012 at 8:22 PM, chethan <ch...@gmail.com> wrote:
> Hi,
>
> If the UDF that is written not extend any of the Built-in-Functions of PIG,
> but still i want to register and use it.
>
> for example:
>
> UDF which will do calculation particular to a work which is cannot be
> extended from the built-in-functions, because of executing that function
> from PIG with all that arguments is not permitting.
> package name: myudf
> class name: material_formation
> function name: func(which will give calculation of specific to the domain)
>
> so how to register this  UDF, whether this is permitted in PIG
> If yes than how to do that.
>
> Thanks & Regards
> chethan prakash