Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15980

Calcite engine. Flaky test SetOpPlannerTest.testSetOpRandom[SetOp = INTERSECT]

    XMLWordPrintableJSON

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

          Activity

            People

              alex_pl Aleksey Plekhanov
              alex_pl Aleksey Plekhanov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h