You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/09/14 07:05:24 UTC

[GitHub] [spark] tanelk commented on a change in pull request #29740: [SPARK-32868][SQL] Add more order irrelevant aggregates to EliminateSorts

tanelk commented on a change in pull request #29740:
URL: https://github.com/apache/spark/pull/29740#discussion_r487692977



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1044,7 +1044,7 @@ object EliminateSorts extends Rule[LogicalPlan] {
 
   private def isOrderIrrelevantAggs(aggs: Seq[NamedExpression]): Boolean = {
     def isOrderIrrelevantAggFunction(func: AggregateFunction): Boolean = func match {
-      case _: Min | _: Max | _: Count => true
+      case _: Min | _: Max | _: Count | _: BitAggregate | _: HyperLogLogPlusPlus => true

Review comment:
       Internally it uses the hash values. From the hash it calculates the bucket id and the max number of leading zeros for all the inputs for each buckets. All of these are deterministic operations, that do not depend on the order of insertion. 




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org