cloud-fan commented on code in PR #47482:
URL: https://github.com/apache/spark/pull/47482#discussion_r1695335692


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -498,7 +498,9 @@ object EliminateDistinct extends Rule[LogicalPlan] {
   override def apply(plan: LogicalPlan): LogicalPlan = 
plan.transformWithPruning(
     _.containsPattern(AGGREGATE)) {
     case agg: Aggregate =>
-      
agg.transformExpressionsWithPruning(_.containsPattern(AGGREGATE_EXPRESSION)) {
+      val isDistinctLiteral = isDistinctLiteralAggregate(agg)
+      var replaceDistinctAggregate = false
+      val newAgg = 
agg.transformExpressionsWithPruning(_.containsPattern(AGGREGATE_EXPRESSION)) {

Review Comment:
   I don't think this is the right rule to put the rewrite, as this is an 
optimization rule. Users can skip it and Spark must still return the right 
result.



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

To unsubscribe, e-mail: [email protected]

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