Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
None
Description
After Calcite version update test SetOpPlannerTest.testSetOpRandom[SetOp = INTERSECT] become flaky:
java.lang.AssertionError: Invalid plan (Unexpected node class [node=rel#2245:IgniteSingleIntersect.IGNITE.[].single.one-way.uncorrelated(input#0=IgniteExchange#2243,input#1=IgniteExchange#2244,all=true), cls=IgniteReduceIntersect]): IgniteSingleIntersect(all=[true]): rowcount = 200.0, cumulative cost = IgniteCost [rowCount=600.0, cpu=600.0, memory=2000.0, io=0.0, network=2400.0], id = 2245 IgniteExchange(distribution=[single]): rowcount = 100.0, cumulative cost = IgniteCost [rowCount=200.0, cpu=200.0, memory=0.0, io=0.0, network=1200.0], id = 2243 IgniteTableScan(table=[[PUBLIC, RANDOM_TBL1]], requiredColumns=[{0, 1, 2}]): rowcount = 100.0, cumulative cost = IgniteCost [rowCount=100.0, cpu=100.0, memory=0.0, io=0.0, network=0.0], id = 2210 IgniteExchange(distribution=[single]): rowcount = 100.0, cumulative cost = IgniteCost [rowCount=200.0, cpu=200.0, memory=0.0, io=0.0, network=1200.0], id = 2244 IgniteTableScan(table=[[PUBLIC, RANDOM_TBL2]], requiredColumns=[{0, 1, 2}]): rowcount = 100.0, cumulative cost = IgniteCost [rowCount=100.0, cpu=100.0, memory=0.0, io=0.0, network=0.0], id = 2213
The root cause: There are two methods getRowCount in IgniteMdRowCount which fits IgniteMapIntersect relational operator as parameter (one accepting IgniteSetOp, and another from super class accepting Intersect). Runtime code-generator choose random of these methods. In last Calcite version row count calculation algorithm of method getRowCount(Intersect) was changed, and if this method is choosen by runtime code generator, there is incorrect cost and planner builds incorrect plan. In debug mode always correct method (getRowCount(IgniteSetOp)) is choosen.
Attachments
Issue Links
- is part of
-
IGNITE-12248 Apache Calcite based query execution engine
- Open
- links to