Details
-
Wish
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
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]])