imback82 commented on a change in pull request #28123:
URL: https://github.com/apache/spark/pull/28123#discussion_r411823192
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala
##########
@@ -159,6 +159,14 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]]
extends Product {
children.foldLeft(Option.empty[BaseType]) { (l, r) => l.orElse(r.find(f)) }
}
+ /**
+ * Tests whether a predicate holds for all nodes.
+ * @param p the predicate function to be applied to each node in the tree.
+ */
+ def forall(p: BaseType => Boolean): Boolean = {
Review comment:
Moved to the caller side.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]