Howdy!
We’re trying to add a vararg/variadic UDF, but cannot seem to make it work out.

In our system, we define our UDFs to the Schema’s function multimap, and so 
have classes with methods which are provided to 
ScalarFunctionImpl.create(theClass, “methodName” ) to create the Function 
object, and from which the parser/validator draws the SQL function signature.
However, there doesn’t seem to be a way do define such a method where 
ScalarFunctionImpl infers the variadic function signature, but rather as 
accepting a single List parameter.

I see that CALCITE-2772 was raised to solve this but the work seems to have 
stalled in review.

Is there any plan to restart this work?
And in the mean time, is there a good way of defining variadic UDFs?

One solution we’ve come up with is to define a function with all (except the 
first) optional parameters so that it *looks* like a variadic function, but 
this is limited to 254 parameters by the JVM.
While 254 parameters is quite a lot, we predict that our users may exceed this 
limit.
Thanks!
-Ian J. Bertolacci

Reply via email to