adamkennedy commented on code in PR #3757:
URL: https://github.com/apache/calcite/pull/3757#discussion_r1562830081


##########
core/src/main/java/org/apache/calcite/tools/RelBuilder.java:
##########
@@ -2503,7 +2503,7 @@ private RelBuilder 
pruneAggregateInputFieldsAndDeduplicateAggCalls(
           builder.add(project.getRowType().getFieldList().get(i));
         }
         r =
-            project.copy(cluster.traitSet(), project.getInput(), newProjects,
+            project.copy(project.getTraitSet(), project.getInput(), 
newProjects,

Review Comment:
   This is what I was thinking of
   `public RelTraitSet apply(Mappings.TargetMapping mapping)`
   
   It appears we have a Mappings.TargetMapping available for the Aggregate call 
from slightly earlier in the function.
   `final Mappings.TargetMapping targetMapping =
               Mappings.target(sourceFieldToTargetFieldMap, 
r.getRowType().getFieldCount(),
                   fieldsUsed.size());`
   
   This would have to be translated down into a TargetMapping of the Project 
pruning...



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