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

Calcite engine. IgniteLimit is pushed down under Exchange invalid

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • sql
    • Docs Required, Release Notes Required

    Description

      In complex cases IgniteLimit is pushed down under Exchange node.

      Steps to reproduce:

      CREATE TABLE test (a VARCHAR);
      INSERT INTO test VALUES ('aaa'), ('bbb'), ('ccc');
      CREATE TABLE test2 (a VARCHAR, b VARCHAR);
      INSERT INTO test2 VALUES ('blabla', 'b'), ('blabla2', 'c'), ('blabla3', 'd');
      
      SELECT NULLIF(NULLIF ((SELECT a FROM test ORDER BY a LIMIT 1 offset 1), a), b) FROM test2;
      

      Plan:

      IgniteProject(EXPR$0=[CASE(=(CASE(=($4, $2), null:VARCHAR CHARACTER SET "UTF-8", $5), $3), null:VARCHAR CHARACTER SET "UTF-8", CASE(=($4, $2), null:VARCHAR CHARACTER SET "UTF-8", $6))])
        IgniteNestedLoopJoin(condition=[true], joinType=[left])
          IgniteNestedLoopJoin(condition=[true], joinType=[left])
            IgniteNestedLoopJoin(condition=[true], joinType=[left])
              IgniteExchange(distribution=[single])
                IgniteIndexScan(table=[[PUBLIC, TEST2]], index=[_key_PK])
              IgniteExchange(distribution=[single])
                IgniteLimit(offset=[1], fetch=[1])
                  IgniteIndexScan(table=[[PUBLIC, TEST]], index=[_key_PK], requiredColumns=[{2}])
            IgniteExchange(distribution=[single])
              IgniteLimit(offset=[1], fetch=[1])
                IgniteIndexScan(table=[[PUBLIC, TEST]], index=[_key_PK], requiredColumns=[{2}])
          IgniteExchange(distribution=[single])
            IgniteLimit(offset=[1], fetch=[1])
              IgniteIndexScan(table=[[PUBLIC, TEST]], index=[_key_PK], requiredColumns=[{2}])
      

      Attachments

        Issue Links

          Activity

            People

              alex_pl Aleksey Plekhanov
              tledkov-gridgain Taras Ledkov
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 1h 10m
                  1h 10m