MaxGekk commented on code in PR #47851:
URL: https://github.com/apache/spark/pull/47851#discussion_r1728463327


##########
sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala:
##########
@@ -331,6 +331,15 @@ class DataFrameFunctionsSuite extends QueryTest with 
SharedSparkSession {
     checkAnswer(df.select(nullif(lit(5), lit(5))), Seq(Row(null)))
   }
 
+  test("nullifzero function") {
+    val df = Seq((0)).toDF("a")
+    checkAnswer(df.selectExpr("nullifzero(0)"), Seq(Row(null)))

Review Comment:
   You have already tested the SQL function in the previous PR. I do believe 
this check is not necessary.



##########
sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala:
##########
@@ -331,6 +331,15 @@ class DataFrameFunctionsSuite extends QueryTest with 
SharedSparkSession {
     checkAnswer(df.select(nullif(lit(5), lit(5))), Seq(Row(null)))
   }
 
+  test("nullifzero function") {
+    val df = Seq((0)).toDF("a")
+    checkAnswer(df.selectExpr("nullifzero(0)"), Seq(Row(null)))
+    checkAnswer(df.select(nullifzero(lit(0))), Seq(Row(null)))
+
+    checkAnswer(df.selectExpr("nullifzero(a)"), Seq(Row(null)))

Review Comment:
   Let's skip this and add more tests for:
   1. Different types: maps, arrays, dates and so on
   2. Not-nullable column
   3. Types support ordering and do not support 
   4. Non-foldable column



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

Reply via email to