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

Support exchange operator in RelFieldTrimmer

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.23.0
    • None
    • None

    Description

      RelFieldTrimmer does not support trim unused fields in exchange operator now.
      Such as below:

      final RelBuilder builder = RelBuilder.create(config().build());
          final RelNode root =
              builder.scan("EMP")
                  .project(builder.field("EMPNO"), builder.field("ENAME"), builder.field("DEPTNO"))
                  .exchange(RelDistributions.hash(Lists.newArrayList(1)))
                  .project(builder.field("EMPNO"), builder.field("ENAME"))
                  .build();
      

      RelNode root:

      LogicalProject(EMPNO=[$0], ENAME=[$1])
        LogicalExchange(distribution=[hash[1]])
          LogicalProject(EMPNO=[$0], ENAME=[$1], DEPTNO=[$7])
            LogicalTableScan(table=[[scott, EMP]])
      

      The right result should be:

      LogicalExchange(distribution=[hash[1]])
        LogicalProject(EMPNO=[$0], ENAME=[$1])
          LogicalTableScan(table=[[scott, EMP]])
      

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            xzh_dz xzh_dz
            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

                Slack

                  Issue deployment