maropu commented on a change in pull request #26534:
[SPARK-29343][SQL][FOLLOW-UP] Remove floating-point
Sum/Average/CentralMomentAgg from order-insensitive aggregates
URL: https://github.com/apache/spark/pull/26534#discussion_r347034147
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1002,12 +1002,13 @@ object EliminateSorts extends Rule[LogicalPlan] {
private 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
+ // Arithmetic operations for floating-point values are order-sensitive
+ // (they are not associative).
+ case _: Sum | _: Average | _: CentralMomentAgg =>
Review comment:
Is that a legal syntax? I tried to change though, I hit a compiler error.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]