zzcclp commented on a change in pull request #31404:
URL: https://github.com/apache/spark/pull/31404#discussion_r573482876
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1007,6 +1007,8 @@ object CombineUnions extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan transformDown {
case u: Union => flattenUnion(u, false)
case Distinct(u: Union) => Distinct(flattenUnion(u, true))
+ case Deduplicate(keys: Seq[Attribute], u: Union) if keys == u.output =>
Review comment:
I have added a test case for the different order case, the condition
work fine, please review, @maropu @cloud-fan , thanks.
----------------------------------------------------------------
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]