[ 
https://issues.apache.org/jira/browse/IGNITE-25353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17954918#comment-17954918
 ] 

Ignite TC Bot commented on IGNITE-25353:
----------------------------------------

{panel:title=Branch: [pull/12085/head] Base: [master] : No blockers 
found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
{panel:title=Branch: [pull/12085/head] Base: [master] : New Tests 
(2)|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}
{color:#00008b}Calcite SQL{color} [[tests 
2|https://ci2.ignite.apache.org/viewLog.html?buildId=8445178]]
* {color:#013220}IgniteCalciteTestSuite: 
CorrelatedSubqueryPlannerTest.testFunctionsRewriteWithCorrelatedSubquery - 
PASSED{color}
* {color:#013220}IgniteCalciteTestSuite: 
FunctionsTest.testRewrittenFunctionWithSubquery - PASSED{color}

{panel}
[TeamCity *--> Run :: All* 
Results|https://ci2.ignite.apache.org/viewLog.html?buildId=8443674&buildTypeId=IgniteTests24Java8_RunAll]

> Calcite engine. NVL with correlated subquery can't be planned
> -------------------------------------------------------------
>
>                 Key: IGNITE-25353
>                 URL: https://issues.apache.org/jira/browse/IGNITE-25353
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Aleksey Plekhanov
>            Assignee: Aleksey Plekhanov
>            Priority: Major
>              Labels: calcite, ise
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Reproducer:
> {code:java}
> /** */
> @Test
> public void testNvl() throws Exception {
>     IgniteSchema schema = createSchema(
>         createTable("T1", IgniteDistributions.single(), "ID", Integer.class),
>         createTable("T2", IgniteDistributions.single(), "ID", Integer.class)
>     );
>     assertPlan("SELECT NVL((SELECT MAX('0') FROM T1 WHERE T1.ID = T2.ID), 
> '1') FROM T2", schema,
>         nodeOrAnyChild(isTableScan("T2")));
> } {code}
> Fails with:
>  
> {noformat}
> Unexpected error at query optimizer.
>  java.lang.AssertionError: Conversion to relational algebra failed to 
> preserve datatypes:
> validated type:
> RecordType(CHAR(1) CHARACTER SET "UTF-8" NOT NULL EXPR$0) NOT NULL
> converted type:
> RecordType(CHAR(1) CHARACTER SET "UTF-8" EXPR$0) NOT NULL
> rel:
> LogicalProject(variablesSet=[[$cor0]], EXPR$0=[CASE(IS NOT 
> NULL($SCALAR_QUERY({
> LogicalAggregate(group=[{}], EXPR$0=[MAX($0)])
>   LogicalProject($f0=[_UTF-8'0'])
>     LogicalFilter(condition=[=($0, $cor0.ID)])
>       IgniteLogicalTableScan(table=[[PUBLIC, T1]])
> })), $SCALAR_QUERY({
> LogicalAggregate(group=[{}], EXPR$0=[MAX($0)])
>   LogicalProject($f0=[_UTF-8'0'])
>     LogicalFilter(condition=[=($0, $cor0.ID)])
>       IgniteLogicalTableScan(table=[[PUBLIC, T1]])
> }), _UTF-8'1')])
>   IgniteLogicalTableScan(table=[[PUBLIC, T2]])
>       at 
> org.apache.calcite.sql2rel.SqlToRelConverter.checkConvertedType(SqlToRelConverter.java:510)
>  ~[calcite-core-1.37.0.jar:1.37.0]
>       at 
> org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:625)
>  ~[calcite-core-1.37.0.jar:1.37.0]
>       at 
> org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.rel(IgnitePlanner.java:344)
>  ~[classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.prepare.PlannerHelper.optimize(PlannerHelper.java:111)
>  [classes/:?]
>  {noformat}
>  
>  



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

Reply via email to