dtenedor commented on code in PR #47851:
URL: https://github.com/apache/spark/pull/47851#discussion_r1733768552
##########
sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala:
##########
@@ -331,6 +331,54 @@ class DataFrameFunctionsSuite extends QueryTest with
SharedSparkSession {
checkAnswer(df.select(nullif(lit(5), lit(5))), Seq(Row(null)))
}
+ test("nullifzero function") {
+ withTable("t") {
+ // Here we exercise a non-nullable, non-foldable column.
+ sql("create table t(col int not null) using csv")
+ sql("insert into t values (0)")
+ val df = sql("select col from t")
+ checkAnswer(df.selectExpr("nullifzero(col)"), Seq(Row(null)))
Review Comment:
Sounds good, done.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]