Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6587#discussion_r31883893
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala 
---
    @@ -68,7 +68,7 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]] {
        * generating case class `equals` methods
        */
       def fastEquals(other: TreeNode[_]): Boolean = {
    -    this.eq(other) || this == other
    +    this.eq(other)// || this == other
    --- End diff --
    
    I thought that also before I made this change, but I don't think that the 
strong reason we should stop this change.
    
    For most of cases in the code, we returns the same references by 
well-design the `rules` for a `TreeNode` object, and if the code still keep 
creating the identical objects(`.equals` returns `true`) in its rule for every 
iteration, even unnecessary, can this be considered as a bug of the user code? 
    
    I think it will be the responsibility for user code to decide whether 
`TreeNode` object substitutions should be taken (via creating new instance), as 
user code always knows when a object substitution needed, right? That's also 
give more freedom for user code to define the `.equals()` in a semantic way for 
`TreeNode` object.


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