Skip to content

Commit 883973b

Browse files
committed
Optimize code
1 parent 39583dd commit 883973b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/RewriteDistinctAggregates.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,7 @@ object RewriteDistinctAggregates extends Rule[LogicalPlan] {
262262
val distinctAggChildAttrMap = distinctAggChildren.map(expressionAttributePair)
263263
val distinctAggChildAttrs = distinctAggChildAttrMap.map(_._2)
264264
// Setup all the filters in distinct aggregate.
265-
val distinctAggExprs = aggExpressions.filter(e => e.isDistinct)
266-
val (distinctAggFilters, distinctAggFilterAttrs, maxConds) = distinctAggExprs.collect {
265+
val (distinctAggFilters, distinctAggFilterAttrs, maxConds) = distinctAggs.collect {
267266
case AggregateExpression(_, _, _, filter, _) if filter.isDefined =>
268267
val (e, attr) = expressionAttributePair(filter.get)
269268
val aggregateExp = Max(attr).toAggregateExpression()

0 commit comments

Comments
 (0)