Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17541#discussion_r110199279
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala 
---
    @@ -372,49 +410,19 @@ abstract class QueryPlan[PlanType <: 
QueryPlan[PlanType]] extends TreeNode[PlanT
        * enhancements like caching.  However, it is not acceptable to return 
true if the results could
        * possibly be different.
        *
    -   * By default this function performs a modified version of equality that 
is tolerant of cosmetic
    -   * differences like attribute naming and or expression id differences. 
Operators that
    -   * can do better should override this function.
    +   * This function performs a modified version of equality that is 
tolerant of cosmetic
    +   * differences like attribute naming and or expression id differences.
        */
    -  def sameResult(plan: PlanType): Boolean = {
    -    val left = this.canonicalized
    -    val right = plan.canonicalized
    -    left.getClass == right.getClass &&
    -      left.children.size == right.children.size &&
    -      left.cleanArgs == right.cleanArgs &&
    -      (left.children, right.children).zipped.forall(_ sameResult _)
    -  }
    +  final def sameResult(other: PlanType): Boolean = this.canonicalized == 
other.canonicalized
    --- End diff --
    
    @dilipbiswal Yes or no. If it is case class, scala compiler will help you 
define a default equals. If it is class, you need to define it by yourselves. 
For example,
    
    ```Scala
    class NestedObj (i: Int)
    
    val m = new NestedObj(3)
    val n = new NestedObj(3)
    
    assert(m != n)
    ```


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

Reply via email to