zzcclp commented on a change in pull request #31404:
URL: https://github.com/apache/spark/pull/31404#discussion_r575770884
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -184,7 +183,8 @@ abstract class Optimizer(catalogManager: CatalogManager)
ReplaceIntersectWithSemiJoin,
ReplaceExceptWithFilter,
ReplaceExceptWithAntiJoin,
- ReplaceDistinctWithAggregate) ::
+ ReplaceDistinctWithAggregate,
+ ReplaceDeduplicateWithAggregate) ::
Review comment:
It needs to put the rule 'CombineUnions' before
ReplaceDistinctWithAggregate and ReplaceDeduplicateWithAggregate, otherwise
these two rules will replace Distinct/Deduplicate to Aggregate and lead to rule
'CombineUnions' is invalid. On the other hand putting the rule
'ReplaceDeduplicateWithAggregate' in batch 'Replace Operators' is more
intuitional.
----------------------------------------------------------------
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]