You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Ran Tao (Jira)" <ji...@apache.org> on 2023/10/24 02:27:00 UTC
[jira] [Comment Edited] (CALCITE-6069) Matching function without arguments are reported as UNKNOWN function
[ https://issues.apache.org/jira/browse/CALCITE-6069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17778902#comment-17778902 ]
Ran Tao edited comment on CALCITE-6069 at 10/24/23 2:26 AM:
------------------------------------------------------------
Yes, if we provide error reports with specific signatures is indeed more user-friendly.
was (Author: lemonjing):
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)