cloud-fan commented on code in PR #46443:
URL: https://github.com/apache/spark/pull/46443#discussion_r1596840882
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/With.scala:
##########
@@ -92,6 +95,21 @@ object With {
val commonExprRefs = commonExprDefs.map(new CommonExpressionRef(_))
With(replaced(commonExprRefs), commonExprDefs)
}
+
+ private[sql] def childContainsUnsupportedAggExpr(withExpr: With): Boolean = {
+ lazy val commonExprIds = withExpr.defs.map(_.id).toSet
+ withExpr.child.exists {
+ case agg: AggregateExpression =>
Review Comment:
nit: ideally we can stop the traversal after hitting `AggregateExpression`
because there can't be nested `AggregateExpression`. This requires to write a
manual top down recursion instead of using `.exist`.
--
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]