RE: UDF with parameters?

2009-05-26 Thread Pradeep Kamath
...@dotspots.com] Sent: Friday, May 22, 2009 3:38 PM To: pig-dev@hadoop.apache.org Subject: UDF with parameters? Hi, I'm interested in developing a PERCENTILE UDF, e.g. for calculating a median, 99th percentile, 90th percentile, etc. I'd like the UDF to be parametric with respect to the percentile being

UDF with parameters?

2009-05-22 Thread Brian Long
Hi, I'm interested in developing a PERCENTILE UDF, e.g. for calculating a median, 99th percentile, 90th percentile, etc. I'd like the UDF to be parametric with respect to the percentile being requested, but I don't see any way to do that, and it seems like I might need to create PERCENTILE_50,

Re: UDF with parameters?

2009-05-22 Thread Alan Gates
Yes, it is possible. The UDF should take the percentage you want as a constructor argument. It will have to be passed as a string and converted. Then in your Pig Latin, you will use the DEFINE statement to pass the argument to the constructor. REGISTER /src/myfunc.jar DEFINE percentile