Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9348#discussion_r43470097
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/OptimizeInSuite.scala
 ---
    @@ -82,4 +83,35 @@ class OptimizeInSuite extends PlanTest {
     
         comparePlans(optimized, correctAnswer)
       }
    +
    +  test("OptimizedIn test: NULL IN (expr1, ..., exprN) gets transformed to 
Filter(null)") {
    +    val originalQuery =
    +      testRelation
    +        .where(In(Literal.create(null, NullType), Seq(Literal(1), 
Literal(2))))
    +        .analyze
    +
    +    val optimized = Optimize.execute(originalQuery.analyze)
    +    val correctAnswer =
    +      testRelation
    +        .where(Literal.create(null, BooleanType))
    +        .analyze
    +
    +    comparePlans(optimized, correctAnswer)
    +  }
    +
    +  test("OptimizedIn test: NULL(StringType) IN (expr1, .., exprN) " +
    --- End diff --
    
    I think the major difference of these 2 test is: the `list` expressions in 
first one all are literals, but in second one it contains attribute, which 
disable the `InSet` optimization. Can you update the test name to reflect that?


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