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

    https://github.com/apache/spark/pull/21539#discussion_r194834520
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala 
---
    @@ -301,6 +290,37 @@ abstract class TreeNode[BaseType <: 
TreeNode[BaseType]] extends Product {
       def mapChildren(f: BaseType => BaseType): BaseType = {
         if (children.nonEmpty) {
           var changed = false
    +      def mapChild(child: Any): Any = child match {
    +        case arg: TreeNode[_] if containsChild(arg) =>
    +          val newChild = f(arg.asInstanceOf[BaseType])
    --- End diff --
    
    These code are duplicated in L326, shall we reuse them?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to