Skip to content

Commit d1658bb

Browse files
committed
Adapt regression test from #25902
Some slight modifications so we no longer depend on Hive.
1 parent b8b67ae commit d1658bb

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3192,6 +3192,32 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession {
31923192
checkAnswer(df3, Array(Row(new java.math.BigDecimal("0.100000000000000000000000100"))))
31933193
}
31943194
}
3195+
3196+
test("SPARK-29213: use IsNotNull in FilterExec to omit null checks for non-output attributes") {
3197+
withView("t1", "t2", "t3") {
3198+
sql("select ''").as[String].map(identity).toDF("x").createOrReplaceTempView("t1")
3199+
sql("select * from values 0, cast(null as bigint)")
3200+
.as[java.lang.Long]
3201+
.map(identity)
3202+
.toDF("x")
3203+
.createOrReplaceTempView("t2")
3204+
sql("select ''").as[String].map(identity).toDF("x").createOrReplaceTempView("t3")
3205+
sql(
3206+
"""
3207+
|select t1.x
3208+
|from t1
3209+
|left join (
3210+
| select x from (
3211+
| select x from t2
3212+
| union all
3213+
| select substr(x,5) x from t3
3214+
| ) a
3215+
| where length(x)>0
3216+
|) t3
3217+
|on t1.x=t3.x
3218+
""".stripMargin).collect()
3219+
}
3220+
}
31953221
}
31963222

31973223
case class Foo(bar: Option[String])

0 commit comments

Comments
 (0)