WangGuangxin commented on a change in pull request #26011: [SPARK-29343][SQL] Eliminate sorts without limit in the subquery of Join/Aggregation URL: https://github.com/apache/spark/pull/26011#discussion_r339435785
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala ########## @@ -987,6 +985,24 @@ object RemoveRedundantSorts extends Rule[LogicalPlan] { case f: Filter => f.condition.deterministic case _ => false } + + def isOrderIrrelevantAggs(aggs: Seq[NamedExpression]): Boolean = { + def isOrderIrrelevantAggFunction(func: AggregateFunction): Boolean = func match { + case _: Sum => true + case _: Min => true + case _: Max => true + case _: Count => true + case _: Average => true + case _: CentralMomentAgg => true + case _ => false + } + + aggs.flatMap { e => Review comment: yes, I'll try to fix it ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org