Skip to content

Commit

Permalink
For comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Sep 4, 2015
1 parent 452cfb5 commit e65f4db
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,15 @@ class Analyzer(
}
}

Project(aggregate.output,
Sort(evaluatedOrderings, global,
aggregate.copy(aggregateExpressions = originalAggExprs ++ needsPushDown)))
// Since we don't rely on sort.resolved as the stop condition for this rule,
// we need to check this and prevent applying this rule multiple times
if (sortOrder == evaluatedOrderings) {
sort
} else {
Project(aggregate.output,
Sort(evaluatedOrderings, global,
aggregate.copy(aggregateExpressions = originalAggExprs ++ needsPushDown)))
}
} catch {
// Attempting to resolve in the aggregate can result in ambiguity. When this happens,
// just return the original plan.
Expand Down

0 comments on commit e65f4db

Please sign in to comment.