You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "beliefer (via GitHub)" <gi...@apache.org> on 2023/07/25 11:20:54 UTC

[GitHub] [spark] beliefer commented on a diff in pull request #42129: [SPARK-44527][SQL] Simplify predicate if its children contain ScalarSubquery with empty output

beliefer commented on code in PR #42129:
URL: https://github.com/apache/spark/pull/42129#discussion_r1273383459


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelation.scala:
##########
@@ -48,10 +48,7 @@ abstract class PropagateEmptyRelationBase extends Rule[LogicalPlan] with CastSup
   // This tag is used to mark a repartition as a root repartition which is user-specified
   private[sql] val ROOT_REPARTITION = TreeNodeTag[Unit]("ROOT_REPARTITION")
 
-  protected def isEmpty(plan: LogicalPlan): Boolean = plan match {
-    case p: LocalRelation => p.data.isEmpty
-    case _ => false
-  }
+  protected def isEmpty(plan: LogicalPlan): Boolean = SimplifyBinaryComparison.isEmpty(plan)

Review Comment:
   Reference SimplifyBinaryComparison here looks a little strange.



-- 
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: reviews-unsubscribe@spark.apache.org

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