maropu commented on a change in pull request #25902: [SPARK-29213][SQL] Make it
consistent when get notnull output and generate null checks in FilterExec
URL: https://github.com/apache/spark/pull/25902#discussion_r328439412
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
##########
@@ -3192,6 +3192,32 @@ class SQLQuerySuite extends QueryTest with
SharedSparkSession {
checkAnswer(df3, Array(Row(new
java.math.BigDecimal("0.100000000000000000000000100"))))
}
}
+
+ test("SPARK-29213: FilterExec should not throw NPE") {
+ withView("t1", "t2", "t3") {
+ sql("select
''").as[String].map(identity).toDF("x").createOrReplaceTempView("t1")
+ sql("select * from values 0, cast(null as bigint)")
+ .as[java.lang.Long]
+ .map(identity)
+ .toDF("x")
+ .createOrReplaceTempView("t2")
+ sql("select
''").as[String].map(identity).toDF("x").createOrReplaceTempView("t3")
+ sql(
+ """
+ |select t1.x
Review comment:
nit: No strict rule though, I like capitalized words for SQL keywords: e.g.,
select -> SELECT, ....
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]