Maksim Zhuravkov created IGNITE-23242:
-----------------------------------------
Summary: Sql. Validator accepts functions that do not exist in
runtime.
Key: IGNITE-23242
URL: https://issues.apache.org/jira/browse/IGNITE-23242
Project: Ignite
Issue Type: Bug
Components: sql
Reporter: Maksim Zhuravkov
The following functions when called with BIGINT arguments at integer positions
are accepted by the validator, but execution of such functions fails with
runtime errors
{code:java}
* OVERLAY: while resolving method 'overlay
* REPEAT: while resolving method 'repeat
* SUBSTRING: while resolving method 'substring
* CHR: while resolving method 'charFromUtf8
* LEFT: while resolving method 'left
* RIGHT: while resolving method 'right
* SPACE: while resolving method in class class ...
* POSITION: while resolving method 'position
{code}
Example with CHR(INT) function.
{code:java}
@Test
public void test() {
sql("SELECT CHR(1000::BIGINT)");
}
{code}
{noformat}
org.apache.ignite.sql.SqlException: IGN-CMN-65535
TraceId:6002aa38-1fae-4e4e-b56c-a8134d3ed2dc while resolving method
'charFromUtf8[long]' in class class org.apache.calcite.runtime.SqlFunctions
....
Caused by: java.lang.NoSuchMethodException:
org.apache.calcite.runtime.SqlFunctions.charFromUtf8(long)
at java.base/java.lang.Class.getMethod(Class.java:2108)
at
org.apache.calcite.adapter.enumerable.EnumUtils.call(EnumUtils.java:663)
... 37 more
{noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)