arkanovicz commented on code in PR #4016:
URL: https://github.com/apache/calcite/pull/4016#discussion_r1817196233
##########
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:
I can do that for `union...` but `childAggCalls` get mutated inside the loop.
##########
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:
I can do that for `union...` but `childAggCalls` gets mutated inside the
loop.
--
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]