Skip to content

Commit 38cd425

Browse files
committed
SPARK-8077: Optimization for TreeNodes with large numbers of children
Add comment about required immutability of children
1 parent d80103b commit 38cd425

File tree

1 file changed

+4
-1
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees

1 file changed

+4
-1
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]] {
5959

6060
val origin: Origin = CurrentOrigin.get
6161

62-
/** Returns a Seq of the children of this node */
62+
/**
63+
* Returns a Seq of the children of this node.
64+
* Children should not change. Immutability required for containsChild optimization
65+
*/
6366
def children: Seq[BaseType]
6467

6568
lazy val containsChild: Set[TreeNode[_]] = children.toSet

0 commit comments

Comments
 (0)