You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/07/02 12:06:23 UTC

[GitHub] [calcite] rubenada commented on a change in pull request #1293: [CALCITE-3165] Project#accept(RexShuttle shuttle) does not update rowType

rubenada commented on a change in pull request #1293: [CALCITE-3165] Project#accept(RexShuttle shuttle) does not update rowType
URL: https://github.com/apache/calcite/pull/1293#discussion_r299447822
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rel/core/Project.java
 ##########
 @@ -145,6 +146,12 @@ public RelNode accept(RexShuttle shuttle) {
     if (this.exps == exps) {
       return this;
     }
+    final RelDataType rowType =
+        RexUtil.createStructType(
 
 Review comment:
   In the real-life scenario when I found this issue, I had a RelHomogeneousShuttle with a RexShuttle performing some modifications, and I saw that the Project copies maintain the "old" rowType, even though they have been modified by the shuttle (as the unit test example):
   ```
   class MyRelNodeShuttle extends RelHomogeneousShuttle {
   	private final RexShuttle myRexShuttle= new RexShuttle() {
   		...
   	};
   
   	@Override public final RelNode visit(RelNode other) {
   		RelNode next = super.visit(other);
   		return next.accept(this.myRexShuttle);
   	}
   }
   ```
   `RelNode relNode2 = relNode.accept(new MyRelNodeShuttle());`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services