Skip to content

Commit 23a46ea

Browse files
committed
Code simplification
1 parent dd20a79 commit 23a46ea

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/planning

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/planning/patterns.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ object PartialAggregation {
146146
case other => (other, Alias(other, "PartialGroup")())
147147
}.toMap
148148

149-
def trimGetFieldAliases(e: Expression) = e.transform { case Alias(g: GetField, _) => g }
150-
151149
// Replace aggregations with a new expression that computes the result from the already
152150
// computed partial evaluations and grouping values.
153151
val rewrittenAggregateExpressions = aggregateExpressions.map(_.transformUp {
@@ -159,8 +157,7 @@ object PartialAggregation {
159157
// resolving struct field accesses, because `GetField` is not a `NamedExpression`.
160158
// (Should we just turn `GetField` into a `NamedExpression`?)
161159
namedGroupingExpressions
162-
.get(e)
163-
.orElse(namedGroupingExpressions.get(trimGetFieldAliases(e)))
160+
.get(e.transform { case Alias(g: GetField, _) => g })
164161
.map(_.toAttribute)
165162
.getOrElse(e)
166163
}).asInstanceOf[Seq[NamedExpression]]

0 commit comments

Comments
 (0)