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 2021/04/22 15:19:10 UTC

[GitHub] [spark] wangyum commented on a change in pull request #32291: [SPARK-35185][SQL] Improve Distinct statistics estimation

wangyum commented on a change in pull request #32291:
URL: https://github.com/apache/spark/pull/32291#discussion_r618498738



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/BasicStatsPlanVisitor.scala
##########
@@ -43,7 +43,10 @@ object BasicStatsPlanVisitor extends LogicalPlanVisitor[Statistics] {
     AggregateEstimation.estimate(p).getOrElse(fallback(p))
   }
 
-  override def visitDistinct(p: Distinct): Statistics = default(p)
+  override def visitDistinct(p: Distinct): Statistics = {
+    val child = p.child
+    visitAggregate(Aggregate(child.output, child.output, child))
+  }

Review comment:
       SPARK-34061 need this change:
   https://github.com/apache/spark/pull/31113/files#diff-9973973f49899b41e043d219f8952275ec344237914e23c53c51a94b1eca9b52R46-R49




-- 
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