Github user dilipbiswal commented on a diff in the pull request:
https://github.com/apache/spark/pull/10156#discussion_r48128315
--- 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 --
@cloud-fan Thank you. I was unable to compile the above snippet test. I
modified it slightly like following.
val relation = LocalRelation('a.struct(StructField("x", IntegerType, true))
,'b.struct(StructField("x", IntegerType, false)))
Does it look ok ? Or i am missing some imports ?
---
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]