I don't think there is a way to provide variable number of inputs to a
drill func currently.
An easy way to make this work would be to include all of the parameters as
a single string, separated by some delimiter, and then split the string
into tokens.


On Fri, May 9, 2014 at 6:15 AM, Yash Sharma <[email protected]> wrote:

> I am trying to implement a reflect UDF for allowing drill to use java
> methods directly:
> https://issues.apache.org/jira/browse/DRILL-345
>
> I would be used like:
>
> SELECT reflect("java.lang.String", "valueOf", 1),
>        reflect("java.lang.String", "isEmpty"),
>        reflect("java.lang.Math", "max", 2, 3),
>        reflect("java.lang.Math", "min", 2, 3),
>        reflect("java.lang.Math", "round", 2.5),
>        reflect("java.lang.Math", "exp", 1.0),
>        reflect("java.lang.Math", "floor", 1.9)FROM src LIMIT 1;
>
> 1   true    3   2   3   2.7182818284590455  1.0
>
>
>
> So, while the first 2 params would be strings, there can be any number of
> parameters following them.
>
> How to I pass variable length arguments to any Drill Function?
> Is something similar to this being done anywhere in the code?
>
> Peace,
> Yash
>



-- 
 Steven Phillips
 Software Engineer

 mapr.com

Reply via email to