[ 
https://issues.apache.org/jira/browse/IGNITE-22417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maksim Zhuravkov updated IGNITE-22417:
--------------------------------------
    Description: 
Calcite uses TypeFamilies in a lot of places to define types of function 
arguments.
This leads to a problem when a function that only accepts INTEGER type also 
accepts BIGINT type, but runtime does not have an implementation of a function 
that accepts long (because there can be no sense in doing so), causing a 
runtime error.

*Example*:

A function *f* can be called with TINYINT, SMALLINT, and INTEGER, but should be 
rejected by the validation when called with BIGINT:

{noformat}
Descriptor: F(<INTEGER>)
Runtime: Fs.f(int)
{noformat}

Validator accepts a call to f(BIGINT) since BIGINT is a part of INTEGER type 
family.
But f(long) is not defined in runtime, so java.lang.NoSuchMethodException: 
Fs.f(long) is thrown when a query get executed.

*Expected behaviour*: when a function does not accept BIGINTs, then the 
validator should return an error.



  was:
Calcite uses TypeFamilies in a lot of places to define types of function 
arguments.
This leads to a problem when a function that only accepts INTEGER type also 
accepts BIGINT type, but runtime does not have an implementation of a function 
that accepts long (because there can be no sense in doing so), causing a 
runtime error.

*Example*:

Say function can be called with TINYINT, SMALLINT, and INTEGER, but should be 
rejected by the validation when called with BIGINT:

{noformat}
Descriptor: F(<INTEGER>)
Runtime: Fs.f(int)
{noformat}

Validator accepts a call to f(BIGINT) since BIGINT is a part of INTEGER type 
family.
But f(long) is not defined in runtime, so java.lang.NoSuchMethodException: 
Fs.f(long) is thrown when a query get executed.

*Expected behaviour*: when a function does not accept BIGINTs, then the 
validator should return an error.




> Sql. Validator accepts f(BIGINT) but f(long) but SQL runtime does not define 
> f(long) it has f(int)
> --------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-22417
>                 URL: https://issues.apache.org/jira/browse/IGNITE-22417
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Maksim Zhuravkov
>            Priority: Major
>              Labels: ignite-3
>
> Calcite uses TypeFamilies in a lot of places to define types of function 
> arguments.
> This leads to a problem when a function that only accepts INTEGER type also 
> accepts BIGINT type, but runtime does not have an implementation of a 
> function that accepts long (because there can be no sense in doing so), 
> causing a runtime error.
> *Example*:
> A function *f* can be called with TINYINT, SMALLINT, and INTEGER, but should 
> be rejected by the validation when called with BIGINT:
> {noformat}
> Descriptor: F(<INTEGER>)
> Runtime: Fs.f(int)
> {noformat}
> Validator accepts a call to f(BIGINT) since BIGINT is a part of INTEGER type 
> family.
> But f(long) is not defined in runtime, so java.lang.NoSuchMethodException: 
> Fs.f(long) is thrown when a query get executed.
> *Expected behaviour*: when a function does not accept BIGINTs, then the 
> validator should return an error.



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

Reply via email to