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 2020/12/16 19:47:35 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #30790: [SPARK-33798][SQL] Simplify EqualTo(CaseWhen/If, Literal) always false

dongjoon-hyun commented on a change in pull request #30790:
URL: https://github.com/apache/spark/pull/30790#discussion_r544576593



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
##########
@@ -470,6 +470,15 @@ object SimplifyConditionals extends Rule[LogicalPlan] with PredicateHelper {
     case _ => false
   }
 
+  private def isAlwaysFalse(exps: Seq[Expression], equalTo: Literal): Boolean = {

Review comment:
       `isAlwaysFalse` seems to be mismatched a little with the behavior of this function. Technically, this function resembles `contains` function where `expr` is a list and `equalTo` literal is the item to be check the containment.
   ```scala
   scala> Seq(1, 2).contains(3)
   res0: Boolean = false
   
   scala> Seq(1, 2).contains(2)
   res1: Boolean = true
   ```




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