Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package io.trino.sql.planner.iterative.rule;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Streams;
import io.trino.Session;
Expand All @@ -36,7 +37,6 @@
import io.trino.sql.planner.plan.ProjectNode;
import org.assertj.core.util.VisibleForTesting;

import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -328,7 +328,7 @@ private PlanNode replaceJoin(

private PlanNode toIntermediateAggregation(AggregationNode partialAggregation, PlanNode source, Context context)
{
Map<Symbol, AggregationNode.Aggregation> intermediateAggregation = new HashMap<>();
ImmutableMap.Builder<Symbol, Aggregation> intermediateAggregation = ImmutableMap.builder();
for (Map.Entry<Symbol, AggregationNode.Aggregation> entry : partialAggregation.getAggregations().entrySet()) {
AggregationNode.Aggregation aggregation = entry.getValue();
ResolvedFunction resolvedFunction = aggregation.getResolvedFunction();
Expand All @@ -353,7 +353,7 @@ private PlanNode toIntermediateAggregation(AggregationNode partialAggregation, P
return new AggregationNode(
context.getIdAllocator().getNextId(),
source,
intermediateAggregation,
intermediateAggregation.buildOrThrow(),
partialAggregation.getGroupingSets(),
// preGroupedSymbols reflect properties of the input. Splitting the aggregation and pushing partial aggregation
// through the join may or may not preserve these properties. Hence, it is safest to drop preGroupedSymbols here.
Expand Down