How to make a UDF that can take a variable number of arguments while using getArgToFuncMapping?

2011-05-20 Thread Jonathan Coveney
My goal is to be able to make functions like GREATER(a,b,c...) which can take any number of columns, and for each row will give the greater of them. I also want to detect what type of columns they are, and use IntGREATER or DoubleGREATER or whatever. A) has someone done something like this? B) If

Re: How to make a UDF that can take a variable number of arguments while using getArgToFuncMapping?

2011-05-20 Thread Daniel Dai
It is not yet supported. See https://issues.apache.org/jira/browse/PIG-1577 Daniel On 05/20/2011 10:42 AM, Jonathan Coveney wrote: My goal is to be able to make functions like GREATER(a,b,c...) which can take any number of columns, and for each row will give the greater of them. I also want to

Re: How to make a UDF that can take a variable number of arguments while using getArgToFuncMapping?

2011-05-20 Thread Thejas M Nair
As a workaround , you can use - MAX(TOBAG(a,b,c)); For example , if a,b,c columns are of type int. Then, TOBAG(a,b,c) will have a schema of bag of integers, and the org.apache.pig.builtin.IntMax class will get used. -Thejas On 5/20/11 11:24 AM, "Daniel Dai" wrote: It is not yet supported.