Github user jiangxb1987 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15977#discussion_r89266916
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
 ---
    @@ -114,10 +114,14 @@ object ReorderAssociativeOperator extends 
Rule[LogicalPlan] {
      * 1. Removes literal repetitions.
      * 2. Replaces [[In (value, seq[Literal])]] with optimized version
      *    [[InSet (value, HashSet[Literal])]] which is much faster.
    + * 3. Replaces [[In (value, Seq.empty)]] with false literal.
      */
     case class OptimizeIn(conf: CatalystConf) extends Rule[LogicalPlan] {
       def apply(plan: LogicalPlan): LogicalPlan = plan transform {
         case q: LogicalPlan => q transformExpressionsDown {
    +      case expr @ In(v, list) if list.isEmpty =>
    --- End diff --
    
    How about we add a new case to handle null literal in value? Like the 
following:
    ```
          case expr @ In(v @ Literal(null, _), list) =>
            v
            
          case expr @ In(v, list) if list.isEmpty =>
            FalseLiteral
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to