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

    https://github.com/apache/spark/pull/10156#discussion_r48123275
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
 ---
    @@ -274,4 +274,12 @@ class AnalysisSuite extends AnalysisTest {
         assert(lits(1) >= min && lits(1) <= max)
         assert(lits(0) == lits(1))
       }
    +
    +  test("SPARK-12102: Ignore nullablity when comparing two sides of case") {
    +    val caseBranches = Seq((Literal(1) > Literal(0)),
    +      CreateStruct(Seq(Cast(Floor(Literal(10)), IntegerType))),
    +      CreateStruct(Seq(Literal(10))))
    +    val plan = OneRowRelation.select(Alias(CaseWhen(caseBranches), 
"val")())
    +    assertAnalysisSuccess(plan)
    --- End diff --
    
    we can simplify this test to:
    ```
    val relation = LocalRelation('a.struct('x.int), 
'b.struct('x.int.withNullability(false)))
    val plan = relation.select(CaseWhen(Seq(Literal(true), 'a, 'b)).as("val"))
    assertAnalysisSuccess(plan)
    ```


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