[
https://issues.apache.org/jira/browse/IGNITE-22762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Aleksey Plekhanov updated IGNITE-22762:
---------------------------------------
Summary: Calcite engine. Validated COALESCE return type not equals to
relational algebra return type (was: Calcite engine. Validated COALESCE return
type can be invalid )
> Calcite engine. Validated COALESCE return type not equals to relational
> algebra return type
> -------------------------------------------------------------------------------------------
>
> Key: IGNITE-22762
> URL: https://issues.apache.org/jira/browse/IGNITE-22762
> Project: Ignite
> Issue Type: Bug
> Reporter: Aleksey Plekhanov
> Priority: Major
> Labels: calcite, ise
>
> Reproducer:
> {noformat}
> sql("select coalesce(?, 1)", 0);
> {noformat}
> Fails with an exception:
> {noformat}
> java.lang.AssertionError: Conversion to relational algebra failed to preserve
> datatypes:
> validated type:
> RecordType(INTEGER NOT NULL EXPR$0) NOT NULL
> converted type:
> RecordType(INTEGER EXPR$0) NOT NULL
> rel:
> LogicalProject(EXPR$0=[CASE(IS NOT NULL(?0), ?0, 1)])
> LogicalValues(tuples=[[{ 0 }]])
> at
> org.apache.calcite.sql2rel.SqlToRelConverter.checkConvertedType(SqlToRelConverter.java:497)
> ~[calcite-core-1.34.0.jar:1.34.0]
> at
> org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:612)
> ~[calcite-core-1.34.0.jar:1.34.0]
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.rel(IgnitePlanner.java:340)
> ~[classes/:?]
> at
> org.apache.ignite.internal.processors.query.calcite.prepare.PlannerHelper.optimize(PlannerHelper.java:76)
> ~[classes/:?]
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)