francis0407 commented on a change in pull request #24344: [SPARK-27440][SQL] 
Optimize uncorrelated predicate subquery
URL: https://github.com/apache/spark/pull/24344#discussion_r274405917
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala
 ##########
 @@ -92,10 +92,16 @@ object RewritePredicateSubquery extends Rule[LogicalPlan] 
with PredicateHelper {
     }
   }
 
+  def isCorrelatedExists(e: Expression): Boolean = e match {
+    case Exists(_, children, _) if children.isEmpty => false
 
 Review comment:
   We have already rewritten uncorrelated `InSubquery` as uncorrelated `Exists` 
ahead of this rule. So we won't have an uncorrelated `InSubquery` here. And 
only `Exists` can be handled in physical plan. Maybe we'd better change the 
name as `isCorrelatedSubquery` to make it more clear.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to