Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9937#discussion_r46233691
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala 
---
    @@ -191,6 +193,19 @@ abstract class TreeNode[BaseType <: 
TreeNode[BaseType]] extends Product {
             case nonChild: AnyRef => nonChild
             case null => null
           }
    +      case m: Map[_, _] => m.mapValues {
    +        case arg: TreeNode[_] if containsChild(arg) =>
    +          val newChild = remainingNewChildren.remove(0)
    +          val oldChild = remainingOldChildren.remove(0)
    +          if (newChild fastEquals oldChild) {
    +            oldChild
    +          } else {
    +            changed = true
    +            newChild
    +          }
    +        case nonChild: AnyRef => nonChild
    +        case null => null
    +      }.view.force
    --- End diff --
    
    yea, `mapValues` is lazy, I'll add a comment to explain it, also add test 
in `TreeNodeSuite`


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