Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3390

ITEM expression does not get pushed to the right input of left-outer-join

    XMLWordPrintableJSON

Details

    Description

      In the following query, the ITEM expression above the Left Outer Join does not get pushed to the right input (null-preserving input) of the join whereas it should since ITEM does not change the nullability.

      explain plan without implementation for select tt7.columns[0], tt8.columns[0] as x from tt7 left outer join tt8  on tt7.columns[0] = tt8.columns[0];
      
       DrillScreenRel
        DrillProjectRel(EXPR$0=[$1], x=[ITEM($2, 0)])
          DrillJoinRel(condition=[=($0, $3)], joinType=[left])
            DrillProjectRel($f2=[ITEM($0, 0)], ITEM=[ITEM($0, 0)])
              DrillScanRel(table=[[dfs, tmp, tt7]], groupscan=[EasyGroupScan [selectionRoot=file:/tmp/tt7, numFiles=1, columns=[`columns`[0]], files=[file:/tmp/tt7/0_0_0.csv]]])
            DrillProjectRel(columns=[$0], $f2=[ITEM($0, 0)])
              DrillScanRel(table=[[dfs, tmp, tt8]], groupscan=[EasyGroupScan [selectionRoot=file:/tmp/tt8, numFiles=1, columns=[`columns`, `columns`[0]], files=[file:/tmp/tt8/0_0_0.csv]]])
      

      From what I can tell, the change in behavior occurred with CALCITE-1753; before that the ITEM was pushed on both sides of the Left Outer Join.

      Attachments

        Issue Links

          Activity

            People

              amansinha100 Aman Sinha
              amansinha100 Aman Sinha
              Votes:
              0 Vote for this issue
              Watchers:
              6 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 - 6h 20m
                  6h 20m