You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "coneyliu (JIRA)" <ji...@apache.org> on 2017/06/13 05:12:01 UTC
[jira] [Created] (SPARK-21072) `TreeNode.mapChildren` should only
apply to the children node.
coneyliu created SPARK-21072:
--------------------------------
Summary: `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[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
}
```
--
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