wangyum commented on a change in pull request #27632: [WIP][SPARK-30872][SQL] 
Constraints inferred from inferred attributes
URL: https://github.com/apache/spark/pull/27632#discussion_r381892261
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/QueryPlanConstraints.scala
 ##########
 @@ -75,7 +85,7 @@ trait ConstraintHelper {
         inferredConstraints ++= replaceConstraints(predicates - eq, l, r)
       case _ => // No inference
     }
-    inferredConstraints -- constraints
+    (inferredConstraints -- constraints).filterNot(i => 
constraints.exists(_.semanticEquals(i)))
 
 Review comment:
   If the `constraint` contains `a = b`. This change is to filter out `b = a`.
   

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


With regards,
Apache Git Services

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

Reply via email to