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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to