[ 
https://issues.apache.org/jira/browse/CALCITE-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16930771#comment-16930771
 ] 

Julian Hyde commented on CALCITE-2772:
--------------------------------------

Reviewing the PR.
* Can you do a "git diff" and remove the formatting changes that are not 
improvements? (Some of them are improvements.)
* Improve the javadoc comments. For example, "Returns the function is var args 
or not." is a circular definition. In that same function, which returns 
`boolean`, "@return Boolean" is not only useless, it is untrue. The key thing 
to explain to developers and users alike that a function with N parameters that 
is varargs can accept N-1, N, N+1, N+2,... arguments, and the extra arguments 
all have the same type.
* Does it make sense to have `FunctionParameter.isVarArgs()`? Only the last 
parameter can be variable. It's really a property of the method, not the 
parameter.
* Let's have some positive and negative SQL validation tests. You should be 
thinking of this feature, and describing it, in terms of the effect on the SQL 
user.
* What happens if you combine arrays and varargs. For example, what SQL 
function signatures do you expect `public static void foo(int x, String[] 
args...)` to generate? I think it needs a test.
* Why a maximum of 1200 arguments? I don't see a reason to have a maximum.

> Support varargs for user-defined functions (UDFs)
> -------------------------------------------------
>
>                 Key: CALCITE-2772
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2772
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: pengzhiwei
>            Assignee: pengzhiwei
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: support_varargs_udf.patch
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Support varargs for user-defined functions as the case followed:
> {code:java}
> public class ConcatWs {
>   public String eval(String sep, String... strs) {...}
> }{code}
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to