cloud-fan commented on code in PR #46143:
URL: https://github.com/apache/spark/pull/46143#discussion_r2566977827
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala:
##########
@@ -404,6 +404,15 @@ abstract class Expression extends TreeNode[Expression] {
} else {
""
}
+
+ /**
+ * Mark if an expression is likely to be expensive.
+ * The current only consumer of this is the pushdown optimizer.
+ * By default an expression is expensive if any of it's children are
expensive.
+ */
+ def expensive: Boolean = hasExpensiveChild
+
+ protected lazy val hasExpensiveChild: Boolean =
children.map(_.expensive).exists(_ == true)
Review Comment:
```suggestion
protected lazy val hasExpensiveChild: Boolean =
children.exists(_.expensive)
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]