Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ngone51 committed Jul 8, 2020
1 parent bb71e83 commit 8314a04
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sql/core/src/test/scala/org/apache/spark/sql/UDFSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,13 @@ class UDFSuite extends QueryTest with SharedSparkSession {
Row(null))
}

test("SPARK-32154: return null without explicit type is not allowed") {
// without explicit type
intercept[ClassNotFoundException](spark.udf.register("returnNull", udf((i: Int) => null)))
// with explicit type
spark.udf.register("returnNull", udf((i: Int) => null.asInstanceOf[Int]))
}

test("SPARK-28321 0-args Java UDF should not be called only once") {
val nonDeterministicJavaUDF = udf(
new UDF0[Int] {
Expand Down

0 comments on commit 8314a04

Please sign in to comment.