viirya commented on a change in pull request #31573:
URL: https://github.com/apache/spark/pull/31573#discussion_r577366266
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/subquery.scala
##########
@@ -85,6 +85,26 @@ object SubqueryExpression {
}.isDefined
}
+ /**
+ * Returns true when an expression contains a scalar subquery
+ */
+ def hasScalarSubquery(e: Expression): Boolean = {
+ e.find {
+ case _: ScalarSubquery => true
+ case _ => false
+ }.isDefined
+ }
+
+ /**
+ * Returns true when an expression contains a non-scalar subquery
+ */
+ def hasNonScalarSubquery(e: Expression): Boolean = {
Review comment:
Isn't it equal to `hasSubquery(e) && !hasScalarSubquery(e)`?
----------------------------------------------------------------
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]