Skip to content

Commit

Permalink
Address comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Apr 2, 2020
1 parent 9024c7e commit 3d12aa6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1188,10 +1188,10 @@ object PushPredicateThroughNonJoin extends Rule[LogicalPlan] with PredicateHelpe

def getAliasMap(plan: Aggregate): AttributeMap[Expression] = {
// Find all the aliased expressions in the aggregate list that don't include any actual
// AggregateExpression, and create a map from the alias to the expression
// AggregateExpression or PythonUDF, and create a map from the alias to the expression
val aliasMap = plan.aggregateExpressions.collect {
case a: Alias if a.child.find(_.isInstanceOf[AggregateExpression]).isEmpty &&
a.child.find(_.isInstanceOf[PythonUDF]).isEmpty =>
case a: Alias if a.child.find(e => e.isInstanceOf[AggregateExpression] ||
e.isInstanceOf[PythonUDF]).isEmpty =>
(a.toAttribute, a.child)
}
AttributeMap(aliasMap)
Expand Down

0 comments on commit 3d12aa6

Please sign in to comment.