Skip to content

Commit 134bdbf

Browse files
committed
Remove redundant toMap method
1 parent 0132cdd commit 134bdbf

25 files changed

+28
-34
lines changed

core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/ExtractDereferencesFromFilterAboveScan.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public Result apply(FilterNode node, Captures captures, Context context)
8484
}
8585

8686
Assignments assignments = Assignments.of(dereferences, context.getSymbolAllocator());
87-
Map<Expression, Reference> mappings = HashBiMap.create(assignments.getMap())
87+
Map<Expression, Reference> mappings = HashBiMap.create(assignments.assignments())
8888
.inverse()
8989
.entrySet().stream()
9090
.collect(toImmutableMap(Map.Entry::getKey, entry -> entry.getValue().toSymbolReference()));

core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/GatherAndMergeWindows.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected static Optional<WindowNode> pullWindowNodeAboveProjects(
139139
// The only kind of use of the output of the target that we can safely ignore is a simple identity propagation.
140140
// The target node, when hoisted above the projections, will provide the symbols directly.
141141
Map<Symbol, Expression> assignmentsWithoutTargetOutputIdentities = Maps.filterKeys(
142-
project.getAssignments().getMap(),
142+
project.getAssignments().assignments(),
143143
output -> !(project.getAssignments().isIdentity(output) && targetOutputs.contains(output)));
144144

145145
if (targetInputs.stream().anyMatch(assignmentsWithoutTargetOutputIdentities::containsKey)) {

core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/InlineProjectIntoFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ public Result apply(FilterNode node, Captures captures, Context context)
164164
newAssignments.putAll(projectNode.getAssignments().filter(symbol -> !postFilterSymbols.contains(symbol)));
165165

166166
Map<Symbol, Expression> outputAssignments = new HashMap<>();
167-
outputAssignments.putAll(Assignments.identity(node.getOutputSymbols()).getMap());
167+
outputAssignments.putAll(Assignments.identity(node.getOutputSymbols()).assignments());
168168
// Restore inlined symbols.
169-
outputAssignments.putAll(postFilterAssignments.getMap());
169+
outputAssignments.putAll(postFilterAssignments.assignments());
170170

171171
return Result.ofPlanNode(new ProjectNode(
172172
context.getIdAllocator().getNextId(),

core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushDownDereferenceThroughFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public Result apply(ProjectNode node, Captures captures, Rule.Context context)
9090
Assignments dereferenceAssignments = Assignments.of(dereferences, context.getSymbolAllocator());
9191

9292
// Rewrite project node assignments using new symbols for dereference expressions
93-
Map<Expression, Reference> mappings = HashBiMap.create(dereferenceAssignments.getMap())
93+
Map<Expression, Reference> mappings = HashBiMap.create(dereferenceAssignments.assignments())
9494
.inverse()
9595
.entrySet().stream()
9696
.collect(toImmutableMap(Map.Entry::getKey, entry -> entry.getValue().toSymbolReference()));

core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushDownDereferenceThroughJoin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public Result apply(ProjectNode projectNode, Captures captures, Context context)
114114
Assignments dereferenceAssignments = Assignments.of(dereferences, context.getSymbolAllocator());
115115

116116
// Rewrite project node assignments using new symbols for dereference expressions
117-
Map<Expression, Reference> mappings = HashBiMap.create(dereferenceAssignments.getMap())
117+
Map<Expression, Reference> mappings = HashBiMap.create(dereferenceAssignments.assignments())
118118
.inverse()
119119
.entrySet().stream()
120120
.collect(toImmutableMap(Map.Entry::getKey, entry -> entry.getValue().toSymbolReference()));

core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushDownDereferenceThroughProject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public Result apply(ProjectNode node, Captures captures, Context context)
8181
Assignments dereferenceAssignments = Assignments.of(dereferences, context.getSymbolAllocator());
8282

8383
// Rewrite project node assignments using new symbols for dereference expressions
84-
Map<Expression, Reference> mappings = HashBiMap.create(dereferenceAssignments.getMap())
84+
Map<Expression, Reference> mappings = HashBiMap.create(dereferenceAssignments.assignments())
8585
.inverse()
8686
.entrySet().stream()
8787
.collect(toImmutableMap(Map.Entry::getKey, entry -> entry.getValue().toSymbolReference()));

core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushDownDereferenceThroughSemiJoin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public Result apply(ProjectNode projectNode, Captures captures, Context context)
9494
Assignments dereferenceAssignments = Assignments.of(dereferences, context.getSymbolAllocator());
9595

9696
// Rewrite project node assignments using new symbols for dereference expressions
97-
Map<Expression, Reference> mappings = HashBiMap.create(dereferenceAssignments.getMap())
97+
Map<Expression, Reference> mappings = HashBiMap.create(dereferenceAssignments.assignments())
9898
.inverse()
9999
.entrySet().stream()
100100
.collect(toImmutableMap(Map.Entry::getKey, entry -> entry.getValue().toSymbolReference()));

core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushDownDereferenceThroughUnnest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public Result apply(ProjectNode projectNode, Captures captures, Context context)
9090
Assignments dereferenceAssignments = Assignments.of(dereferences, context.getSymbolAllocator());
9191

9292
// Rewrite project node assignments using new symbols for dereference expressions
93-
Map<Expression, Reference> mappings = HashBiMap.create(dereferenceAssignments.getMap())
93+
Map<Expression, Reference> mappings = HashBiMap.create(dereferenceAssignments.assignments())
9494
.inverse()
9595
.entrySet().stream()
9696
.collect(toImmutableMap(Map.Entry::getKey, entry -> entry.getValue().toSymbolReference()));

core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushDownDereferencesThroughAssignUniqueId.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public Result apply(ProjectNode projectNode, Captures captures, Context context)
8282
Assignments dereferenceAssignments = Assignments.of(dereferences, context.getSymbolAllocator());
8383

8484
// Rewrite project node assignments using new symbols for dereference expressions
85-
Map<Expression, Reference> mappings = HashBiMap.create(dereferenceAssignments.getMap())
85+
Map<Expression, Reference> mappings = HashBiMap.create(dereferenceAssignments.assignments())
8686
.inverse()
8787
.entrySet().stream()
8888
.collect(toImmutableMap(Map.Entry::getKey, entry -> entry.getValue().toSymbolReference()));

core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushDownDereferencesThroughLimit.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public Result apply(ProjectNode projectNode, Captures captures, Context context)
9696
Assignments dereferenceAssignments = Assignments.of(dereferences, context.getSymbolAllocator());
9797

9898
// Rewrite project node assignments using new symbols for dereference expressions
99-
Map<Expression, Reference> mappings = HashBiMap.create(dereferenceAssignments.getMap())
99+
Map<Expression, Reference> mappings = HashBiMap.create(dereferenceAssignments.assignments())
100100
.inverse()
101101
.entrySet().stream()
102102
.collect(toImmutableMap(Map.Entry::getKey, entry -> entry.getValue().toSymbolReference()));

0 commit comments

Comments
 (0)