Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-6093

Unneeded columns in Drill logical project

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.11.0, 1.12.0
    • 1.13.0
    • None

    Description

      Here is an example query with the corresponding logical plan. The project contains unnecessary columns L_ORDERKEY, O_ORDERKEY in the projection even when it is not required by subsequent operators e.g. DrillJoinRel.

      EXPLAIN PLAN without implementation FOR SELECT L.L_QUANTITY FROM cp.`tpch/lineitem.parquet` L, cp.`tpch/orders.parquet` O WHERE cast(L.L_ORDERKEY as int) = cast(O.O_ORDERKEY as int);

      ----------+

      | text | json |

      ----------+

      | DrillScreenRel

        DrillProjectRel(L_QUANTITY=[$1])

          DrillJoinRel(condition=[=($2, $4)], joinType=[inner])

            DrillProjectRel(L_ORDERKEY=[$0], L_QUANTITY=[$1], $f2=[CAST($0):INTEGER])

              DrillScanRel(table=[[cp, tpch/lineitem.parquet]], groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=classpath:/tpch/lineitem.parquet]], selectionRoot=classpath:/tpch/lineitem.parquet, numFiles=1, numRowGroups=1, usedMetadataFile=false, columns=[`L_ORDERKEY`, `L_QUANTITY`]]])

            DrillProjectRel(O_ORDERKEY=[$0], $f1=[CAST($0):INTEGER])

              DrillScanRel(table=[[cp, tpch/orders.parquet]], groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=classpath:/tpch/orders.parquet]], selectionRoot=classpath:/tpch/orders.parquet, numFiles=1, numRowGroups=1, usedMetadataFile=false, columns=[`O_ORDERKEY`]]])

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            gparai Gautam Parai
            gparai Gautam Parai
            Aman Sinha Aman Sinha
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment