spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "coneyliu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SPARK-21072) `TreeNode.mapChildren` should only apply to the children node.
Date Tue, 13 Jun 2017 05:14:00 GMT

     [ https://issues.apache.org/jira/browse/SPARK-21072?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

coneyliu updated SPARK-21072:
-----------------------------
    Description: 
Just as the function name and comments of `TreeNode.mapChildren` mentioned, the function should
be apply to all currently node children. So, the follow code  should judge whether it is the
children node.

[https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala#L342]

  was:
Just as the function name and comments of `TreeNode.mapChildren` mentioned, the function should
be apply to all currently node children. So, the follow code [https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala#L342]
should judge whether it is the children node.

```
case tuple@(arg1: TreeNode[_], arg2: TreeNode[_]) =>
            val newChild1 = f(arg1.asInstanceOf[BaseType])
            val newChild2 = f(arg2.asInstanceOf[BaseType])
            if (!(newChild1 fastEquals arg1) || !(newChild2 fastEquals arg2)) {
              changed = true
              (newChild1, newChild2)
            } else {
              tuple
            }
```


> `TreeNode.mapChildren` should only apply to the children node. 
> ---------------------------------------------------------------
>
>                 Key: SPARK-21072
>                 URL: https://issues.apache.org/jira/browse/SPARK-21072
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.1.1
>            Reporter: coneyliu
>
> Just as the function name and comments of `TreeNode.mapChildren` mentioned, the function
should be apply to all currently node children. So, the follow code  should judge whether
it is the children node.
> [https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala#L342]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message