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

Support exchange operator in RelFieldTrimmer

    XMLWordPrintableJSON

    Details

    • Type: Wish
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.23.0
    • Component/s: None
    • Labels:
      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

            People

            • Assignee:
              Unassigned
              Reporter:
              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