NobiGo commented on code in PR #4016:
URL: https://github.com/apache/calcite/pull/4016#discussion_r1816537794


##########
core/src/main/java/org/apache/calcite/rel/rules/AggregateUnionTransposeRule.java:
##########
@@ -153,9 +153,31 @@ public AggregateUnionTransposeRule(Class<? extends 
Aggregate> aggregateClass,
     // create corresponding aggregates on top of each union child
     final RelBuilder relBuilder = call.builder();
     for (RelNode input : union.getInputs()) {
+      List<AggregateCall> childAggCalls = new 
ArrayList<>(aggRel.getAggCallList());
+      // if the nullability of a specific input column differs from the 
nullability
+      // of the union'ed column, we need to re-evaluate the nullability of the 
aggregate
+      RelDataType origUnionType = union.getRowType();

Review Comment:
   Maybe we can extract `union.getRowType()..getFieldList()`  and 
`childAggCalls` to the outside of the `for` loop. It's up to you!



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