Github user chenghao-intel commented on the pull request:

    https://github.com/apache/spark/pull/6587#issuecomment-111315693
  
    @marmbrus thanks for explanation.
    I am not so sure what kind of bugs you've seen, but as you know we have 
lots of places use the `Set[Expression]` and `Map[Expression]`, those 
scala/java collections are naturely rely on the `.hashCode()` and `equals()` 
method, not the `semanticEquals`, and definitely will cause weird bugs for the 
developers who is new to Catalyst. I believe that will keep happening.
    
    For performance concern, I don't think that's a issue! If the user code 
return a different instance reference from the transformation rule, why should 
we call its `equal()` method and then decide whether the substitution takes, 
why not just return the same instance if the user code doesn't want to change 
anything? One scenario that I can assume is the deep copy a `TreeNode` for 
further analysis without  change the original one, as the `equals()` will be 
considered in the substitution, I am not sure what's the easiest way to do this.


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