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

Ran Tao commented on CALCITE-6069:
----------------------------------

I get you point. But my point is what is the scope of your search function? 
Calcite's default operatorTable does not contain other library functions, such 
as mysql library/pg/spark... If each function comes and searches these library 
functions, it may cause performance problems. Another point is that functions 
in different libraries may have the same name, but their signatures and 
implementation logic are different.

So I guess this optimization can be fixed/done within a fixed range(depends on 
the function scope that can currently be searched).  do i understand correctly?

> Matching function without arguments are reported as UNKNOWN function
> --------------------------------------------------------------------
>
>                 Key: CALCITE-6069
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6069
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Bonnie Varghese
>            Priority: Major
>
> In Flink, when I run a function without arguments I get the following error:
> {code:java}
> Flink SQL> SELECT ARRAY_JOIN(); [ERROR] Could not execute SQL statement. 
> Reason: org.apache.calcite.sql.validate.SqlValidatorException: No match found 
> for function signature ARRAY_JOIN{code}
> The function (handleUnresolvedFunction) 
> [https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L1982]
>  only deals with Invalid number of arguments and rest is classified as 
> Unknown functions.
> However, if the validation can report it as a No match found for function 
> signature and the expected signatures, it can help getting started with 
> functions without going to read the documentation.
> So, the proposal is to add a new CalciteException for No Function 
> Match(validatorNoMatchFunction) similar to validatorUnknownFunction  
> [https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/runtime/CalciteResource.java#L141]
>  and use that to improve the error message as follows:
> Suggested improved error message:
> {code:java}
> Flink SQL> SELECT ARRAY_JOIN();
> [ERROR] Could not execute SQL statement. Reason:
> org.apache.calcite.sql.validate.SqlValidatorException: No match found for 
> function signature ARRAY_JOIN().
> Supported signatures are:
> ARRAY_JOIN(ARRAY<STRING>, <CHARACTER_STRING>)
> ARRAY_JOIN(ARRAY<STRING>, <CHARACTER_STRING>, <CHARACTER_STRING>){code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to