rubenada commented on code in PR #2829:
URL: https://github.com/apache/calcite/pull/2829#discussion_r895432134


##########
core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java:
##########
@@ -297,11 +297,15 @@ protected final TrimResult dispatchTrimFields(
       assert newFieldCount > 0 : "rel has no fields after trim: " + rel;
     }
     if (newRel.equals(rel)) {
-      return result(rel, mapping);
+      return result(rel, mapping, rel);
     }

Review Comment:
   @danny0405 I can create a minor follow-up PR to deal with these details:
   - Remove third parameter from RelFieldTrimmer:300
   - Add early exit in `RelOptUtil.copyRelHints`:
   ```
   public static RelNode copyRelHints(RelNode originalRel, RelNode newRel, 
boolean filterHints) {
     if (originalRel == newRel && !filterHints) {
       return originalRel;
     }
     ...
   ```
   wdyt?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to