You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by wrstrs <wr...@foxmail.com> on 2021/07/26 12:01:46 UTC

No match found for function signature IF

hi, all

how to solve this problem?




Caused by: org.apache.calcite.sql.validate.SqlValidatorException: No match found for function signature IF(<BOOLEAN&gt;, <NUMERIC&gt;, <NUMERIC&gt;)

	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

Re: No match found for function signature IF

Posted by Yanjing Wang <zh...@gmail.com>.
Could you paste your code that shows how the SqlOperatorTable is
constructed?  the IF operator is defined in SqlLibraryOperators class and
you can get corresponding operator table through SqlOperatorTable opTab =
SqlLibraryOperatorTableFactory.INSTANCE.getOperatorTable(EnumSet.of(SqlLibrary
sqlLibrary)), any of SqlLibrary.BIG_QUERY, SqlLibrary.HIVE,
SqlLibrary.SPARK will work. Another option may be
SqlValidator.Config.DEFAULT.withLenientOperatorLookup(true), which will be
lenient when encountering an unknown function.

wrstrs <wr...@foxmail.com> 于2021年7月26日周一 下午8:02写道:

> hi, all
>
> how to solve this problem?
>
>
>
>
> Caused by: org.apache.calcite.sql.validate.SqlValidatorException: No match
> found for function signature IF(<BOOLEAN&gt;, <NUMERIC&gt;, <NUMERIC&gt;)
>
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>
>         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:423)