You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/02/17 06:57:31 UTC

[GitHub] [spark] viirya commented on a change in pull request #31573: [SPARK-34444][SQL] Pushdown scalar-subquery filter to FileSourceScan

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org