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

Sergey Korotkov resolved IGNITE-24757.
--------------------------------------
    Resolution: Fixed

> Calcite. TPC-H query #21: failed to plan query for scale=0.01
> -------------------------------------------------------------
>
>                 Key: IGNITE-24757
>                 URL: https://issues.apache.org/jira/browse/IGNITE-24757
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Sergey Korotkov
>            Assignee: Vladimir Steshin
>            Priority: Major
>              Labels: ise, tpch
>
> Sometimes fails in planning for scale=0.01
> Looks like works now for scale=0.1 and 1.0 after one of the fixes 
> IGNITE-24666 and IGNITE-24688. Before it didn't complete in 10 minutes.
> {noformat}
> [2025-03-21T17:58:42,716][WARN ][test-runner-#494%tpch.TpchQ21Test%][task] 
> Volcano planning times out, cancels the subsequent optimization.
> [2025-03-21T17:58:42,726][ERROR][test-runner-#494%tpch.TpchQ21Test%][PrepareServiceImpl]
>  Unexpected error at query optimizer.
>  org.apache.calcite.plan.RelOptPlanner$CannotPlanException: There are not 
> enough rules to produce a node with desired properties: convention=IGNITE, 
> sort=[1 DESC-nulls-last, 0 ASC-nulls-first], distr=single, 
> rewindability=one-way, correlation=uncorrelated.
> Missing conversions are LogicalAggregate[convention: NONE -> IGNITE, 
> rewindability: one-way -> rewindable] (2 cases), LogicalAggregate[convention: 
> NONE -> IGNITE, distr: any -> single, rewindability: one-way -> rewindable] 
> (2 cases)
> There are 4 empty subsets:
> Empty subset 0: 
> rel#486:RelSubset#10.IGNITE.[].any.rewindable.correlated[$cor4], the relevant 
> part of the original plan is as follows
> 261:LogicalAggregate(group=[{0}])
>   
> 259:LogicalProject(subset=[rel#260:RelSubset#9.NONE.[].any.one-way.uncorrelated],
>  i=[true])
>     
> 257:LogicalFilter(subset=[rel#258:RelSubset#8.NONE.[].any.one-way.uncorrelated],
>  condition=[AND(=($0, $cor4.L_ORDERKEY), <>($1, $cor4.L_SUPPKEY))])
>       
> 239:IgniteLogicalTableScan(subset=[rel#256:RelSubset#7.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, LINEITEM]], requiredColumns=[{2, 4}])
> Empty subset 1: 
> rel#490:RelSubset#10.IGNITE.[].single.rewindable.correlated[$cor4], the 
> relevant part of the original plan is as follows
> 261:LogicalAggregate(group=[{0}])
>   
> 259:LogicalProject(subset=[rel#260:RelSubset#9.NONE.[].any.one-way.uncorrelated],
>  i=[true])
>     
> 257:LogicalFilter(subset=[rel#258:RelSubset#8.NONE.[].any.one-way.uncorrelated],
>  condition=[AND(=($0, $cor4.L_ORDERKEY), <>($1, $cor4.L_SUPPKEY))])
>       
> 239:IgniteLogicalTableScan(subset=[rel#256:RelSubset#7.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, LINEITEM]], requiredColumns=[{2, 4}])
> Empty subset 2: 
> rel#478:RelSubset#15.IGNITE.[].any.rewindable.correlated[$cor0], the relevant 
> part of the original plan is as follows
> 270:LogicalAggregate(group=[{0}])
>   
> 268:LogicalProject(subset=[rel#269:RelSubset#14.NONE.[].any.one-way.uncorrelated],
>  i=[true])
>     
> 266:LogicalFilter(subset=[rel#267:RelSubset#13.NONE.[].any.one-way.uncorrelated],
>  condition=[AND(=($0, $cor0.L_ORDERKEY), <>($1, $cor0.L_SUPPKEY), >($3, $2))])
>       
> 241:IgniteLogicalTableScan(subset=[rel#265:RelSubset#12.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, LINEITEM]], requiredColumns=[{2, 4, 13, 14}])
> Empty subset 3: 
> rel#483:RelSubset#15.IGNITE.[].single.rewindable.correlated[$cor0], the 
> relevant part of the original plan is as follows
> 270:LogicalAggregate(group=[{0}])
>   
> 268:LogicalProject(subset=[rel#269:RelSubset#14.NONE.[].any.one-way.uncorrelated],
>  i=[true])
>     
> 266:LogicalFilter(subset=[rel#267:RelSubset#13.NONE.[].any.one-way.uncorrelated],
>  condition=[AND(=($0, $cor0.L_ORDERKEY), <>($1, $cor0.L_SUPPKEY), >($3, $2))])
>       
> 241:IgniteLogicalTableScan(subset=[rel#265:RelSubset#12.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, LINEITEM]], requiredColumns=[{2, 4, 13, 14}])
> Root: rel#284:RelSubset#21.IGNITE.[1 DESC-nulls-last, 0 
> ASC-nulls-first].single.one-way.uncorrelated
> Original rel:
> LogicalSort(subset=[rel#284:RelSubset#21.IGNITE.[1 DESC-nulls-last, 0 
> ASC-nulls-first].single.one-way.uncorrelated], sort0=[$1], sort1=[$0], 
> dir0=[DESC-nulls-last], dir1=[ASC-nulls-first], fetch=[100]): rowcount = 
> 2.7267694333560168E13, cumulative cost = IgniteCost [rowCount=Infinity, 
> cpu=Infinity, memory=Infinity, io=Infinity, network=Infinity], id = 282
>   
> LogicalAggregate(subset=[rel#281:RelSubset#20.NONE.[].any.one-way.uncorrelated],
>  group=[{0}], NUMWAIT=[COUNT()]): rowcount = 2.7267694333560168E13, 
> cumulative cost = IgniteCost [rowCount=Infinity, cpu=Infinity, 
> memory=Infinity, io=Infinity, network=Infinity], id = 280
>     
> LogicalProject(subset=[rel#279:RelSubset#19.NONE.[].any.one-way.uncorrelated],
>  S_NAME=[$0]): rowcount = 5.4535388667120336E13, cumulative cost = IgniteCost 
> [rowCount=Infinity, cpu=Infinity, memory=Infinity, io=Infinity, 
> network=Infinity], id = 278
>       
> LogicalFilter(subset=[rel#277:RelSubset#18.NONE.[].any.one-way.uncorrelated], 
> condition=[IS NULL($1)]): rowcount = 5.4535388667120336E13, cumulative cost = 
> IgniteCost [rowCount=Infinity, cpu=Infinity, memory=Infinity, io=Infinity, 
> network=Infinity], id = 276
>         
> LogicalProject(subset=[rel#275:RelSubset#17.NONE.[].any.one-way.uncorrelated],
>  S_NAME=[$3], i0=[$45]): rowcount = 2.1814155466848134E14, cumulative cost = 
> IgniteCost [rowCount=Infinity, cpu=Infinity, memory=Infinity, io=Infinity, 
> network=Infinity], id = 274
>           
> LogicalCorrelate(subset=[rel#273:RelSubset#16.NONE.[].any.one-way.uncorrelated],
>  correlation=[$cor0], joinType=[left], requiredColumns=[{11, 13}]): rowcount 
> = 2.1814155466848134E14, cumulative cost = IgniteCost [rowCount=Infinity, 
> cpu=Infinity, memory=Infinity, io=Infinity, network=Infinity], id = 272
>             
> LogicalCorrelate(subset=[rel#264:RelSubset#11.NONE.[].any.one-way.uncorrelated],
>  correlation=[$cor4], joinType=[inner], requiredColumns=[{11, 13}]): rowcount 
> = 1.933396967010498E11, cumulative cost = IgniteCost [rowCount=Infinity, 
> cpu=Infinity, memory=Infinity, io=Infinity, network=Infinity], id = 263
>               
> LogicalJoin(subset=[rel#255:RelSubset#6.NONE.[].any.one-way.uncorrelated], 
> condition=[=($5, $40)], joinType=[inner]): rowcount = 8.5678857421875E7, 
> cumulative cost = IgniteCost [rowCount=Infinity, cpu=Infinity, 
> memory=Infinity, io=Infinity, network=Infinity], id = 254
>                 
> LogicalJoin(subset=[rel#252:RelSubset#4.NONE.[].any.one-way.uncorrelated], 
> condition=[=($29, $11)], joinType=[inner]): rowcount = 1.5231796875E8, 
> cumulative cost = IgniteCost [rowCount=Infinity, cpu=Infinity, 
> memory=Infinity, io=Infinity, network=Infinity], id = 251
>                   
> LogicalJoin(subset=[rel#249:RelSubset#2.NONE.[].any.one-way.uncorrelated], 
> condition=[=($2, $13)], joinType=[inner]): rowcount = 451312.5, cumulative 
> cost = IgniteCost [rowCount=Infinity, cpu=Infinity, memory=Infinity, 
> io=Infinity, network=Infinity], id = 248
>                     
> IgniteLogicalTableScan(subset=[rel#246:RelSubset#0.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, SUPPLIER]]): rowcount = 100.0, cumulative cost = IgniteCost 
> [rowCount=Infinity, cpu=Infinity, memory=Infinity, io=Infinity, 
> network=Infinity], id = 1
>                     
> IgniteLogicalTableScan(subset=[rel#247:RelSubset#1.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, LINEITEM]], filters=[>($t14, $t13)]): rowcount = 30087.5, 
> cumulative cost = IgniteCost [rowCount=Infinity, cpu=Infinity, 
> memory=Infinity, io=Infinity, network=Infinity], id = 182
>                   
> IgniteLogicalTableScan(subset=[rel#250:RelSubset#3.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, ORDERS]], filters=[=($t4, _UTF-8'F')]): rowcount = 2250.0, 
> cumulative cost = IgniteCost [rowCount=Infinity, cpu=Infinity, 
> memory=Infinity, io=Infinity, network=Infinity], id = 184
>                 
> IgniteLogicalTableScan(subset=[rel#253:RelSubset#5.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, NATION]], filters=[=($t3, _UTF-8'SAUDI ARABIA')]): rowcount 
> = 3.75, cumulative cost = IgniteCost [rowCount=Infinity, cpu=Infinity, 
> memory=Infinity, io=Infinity, network=Infinity], id = 186
>               
> LogicalAggregate(subset=[rel#262:RelSubset#10.NONE.[].any.one-way.uncorrelated],
>  group=[{0}]): rowcount = 2256.5625, cumulative cost = IgniteCost 
> [rowCount=Infinity, cpu=Infinity, memory=Infinity, io=Infinity, 
> network=Infinity], id = 261
>                 
> LogicalProject(subset=[rel#260:RelSubset#9.NONE.[].any.one-way.uncorrelated], 
> i=[true]): rowcount = 4513.125, cumulative cost = IgniteCost 
> [rowCount=Infinity, cpu=Infinity, memory=Infinity, io=Infinity, 
> network=Infinity], id = 259
>                   
> LogicalFilter(subset=[rel#258:RelSubset#8.NONE.[].any.one-way.uncorrelated], 
> condition=[AND(=($0, $cor4.L_ORDERKEY), <>($1, $cor4.L_SUPPKEY))]): rowcount 
> = 4513.125, cumulative cost = IgniteCost [rowCount=Infinity, cpu=Infinity, 
> memory=Infinity, io=Infinity, network=Infinity], id = 257
>                     
> IgniteLogicalTableScan(subset=[rel#256:RelSubset#7.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, LINEITEM]], requiredColumns=[{2, 4}]): rowcount = 60175.0, 
> cumulative cost = IgniteCost [rowCount=Infinity, cpu=Infinity, 
> memory=Infinity, io=Infinity, network=Infinity], id = 239
>             
> LogicalAggregate(subset=[rel#271:RelSubset#15.NONE.[].any.one-way.uncorrelated],
>  group=[{0}]): rowcount = 1128.28125, cumulative cost = IgniteCost 
> [rowCount=Infinity, cpu=Infinity, memory=Infinity, io=Infinity, 
> network=Infinity], id = 270
>               
> LogicalProject(subset=[rel#269:RelSubset#14.NONE.[].any.one-way.uncorrelated],
>  i=[true]): rowcount = 2256.5625, cumulative cost = IgniteCost 
> [rowCount=Infinity, cpu=Infinity, memory=Infinity, io=Infinity, 
> network=Infinity], id = 268
>                 
> LogicalFilter(subset=[rel#267:RelSubset#13.NONE.[].any.one-way.uncorrelated], 
> condition=[AND(=($0, $cor0.L_ORDERKEY), <>($1, $cor0.L_SUPPKEY), >($3, 
> $2))]): rowcount = 2256.5625, cumulative cost = IgniteCost 
> [rowCount=Infinity, cpu=Infinity, memory=Infinity, io=Infinity, 
> network=Infinity], id = 266
>                   
> IgniteLogicalTableScan(subset=[rel#265:RelSubset#12.NONE.[].any.one-way.uncorrelated],
>  table=[[PUBLIC, LINEITEM]], requiredColumns=[{2, 4, 13, 14}]): rowcount = 
> 60175.0, cumulative cost = IgniteCost [rowCount=Infinity, cpu=Infinity, 
> memory=Infinity, io=Infinity, network=Infinity], id = 241
>       at 
> org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:718)
>  ~[calcite-core-1.37.0.jar:1.37.0]
>       at 
> org.apache.calcite.plan.volcano.RelSubset.buildCheapestPlan(RelSubset.java:391)
>  ~[calcite-core-1.37.0.jar:1.37.0]
>       at 
> org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:534)
>  ~[calcite-core-1.37.0.jar:1.37.0]
>       at 
> org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:328) 
> ~[calcite-core-1.37.0.jar:1.37.0]
>       at 
> org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.transform(IgnitePlanner.java:381)
>  ~[classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.prepare.PlannerHelper.optimize(PlannerHelper.java:107)
>  ~[classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareQuery(PrepareServiceImpl.java:168)
>  ~[classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:94)
>  ~[classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$5(CalciteQueryProcessor.java:553)
>  ~[classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.lambda$queryPlan$0(QueryPlanCacheImpl.java:70)
>  ~[classes/:?]
>       at 
> java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330)
>  ~[?:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:70)
>  ~[classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$6(CalciteQueryProcessor.java:550)
>  ~[classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.processQuery(CalciteQueryProcessor.java:701)
>  [classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.parseAndProcessQuery(CalciteQueryProcessor.java:547)
>  [classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:420)
>  [classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.integration.AbstractBasicIntegrationTest.sql(AbstractBasicIntegrationTest.java:241)
>  [test-classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.integration.AbstractBasicIntegrationTest.sql(AbstractBasicIntegrationTest.java:236)
>  [test-classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.integration.tpch.TpchQ21Test.testQ21(TpchQ21Test.java:39)
>  [test-classes/:?]
>       at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method) ~[?:?]
>       at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>  ~[?:?]
>       at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  ~[?:?]
>       at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
>       at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>  [junit-4.12.jar:4.12]
>       at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>  [junit-4.12.jar:4.12]
>       at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
>  [junit-4.12.jar:4.12]
>       at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>  [junit-4.12.jar:4.12]
>       at 
> org.apache.ignite.testframework.junits.GridAbstractTest$6.run(GridAbstractTest.java:2493)
>  [test-classes/:?]
>       at java.base/java.lang.Thread.run(Thread.java:829) [?:?]
> {noformat}



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

Reply via email to