Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/10163#discussion_r47064418
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
---
@@ -156,7 +156,18 @@ abstract class Expression extends TreeNode[Expression]
{
if (!deterministic || !other.deterministic) return false
val elements1 = this.productIterator.toSeq
val elements2 = other.asInstanceOf[Product].productIterator.toSeq
- checkSemantic(elements1, elements2)
+
+
+ (this, other) match {
+ // tolerant of ordering different
+ case (left: And, right: And) =>
+ checkSemantic(splitConjunctivePredicates(left).toSet.toSeq,
+ splitConjunctivePredicates(right).toSet.toSeq)
+ case (left: Or, right: Or) =>
+ checkSemantic(splitDisjunctivePredicates(left).toSet.toSeq,
+ splitDisjunctivePredicates(right).toSet.toSeq)
+ case _ => checkSemantic(elements1, elements2)
+ }
--- End diff --
Sorry I didn't clarify it clearly. I mean we can override `semanticEquals`
in concrete expressions like `Or`, `And`, etc. And we don't need to support all
commutative operators at once, you can only finish the predicates parts in this
PR and open follow-up PRs for other parts(like `Add`, `Multiply`). Let's do it
step-by-step :)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]