yaooqinn commented on code in PR #40747:
URL: https://github.com/apache/spark/pull/40747#discussion_r1166302920


##########
sql/core/src/test/scala/org/apache/spark/sql/UDFSuite.scala:
##########
@@ -1060,4 +1063,29 @@ class UDFSuite extends QueryTest with SharedSparkSession 
{
     }.getCause.getCause
     assert(e.isInstanceOf[java.lang.ArithmeticException])
   }
+
+  class TestPythonFunc extends SimplePythonFunction(
+    command = Array[Byte](),
+    envVars = null,
+    pythonIncludes = null,
+    pythonExec = "",
+    pythonVer = "",
+    broadcastVars = null,
+    accumulator = null
+  )
+
+  class DummyUDF extends UserDefinedPythonFunction(
+    name = "DummyUDF",
+    func = new TestPythonFunc,
+    dataType = BooleanType,
+    pythonEvalType = PythonEvalType.SQL_BATCHED_UDF,
+    udfDeterministic = true
+  )
+
+  test("SPARK-43099: UDF className is correctly populated") {
+    spark.udf.registerPython("dummyUDF", new DummyUDF)
+    val expressionInfo = spark.sessionState.catalog
+      .lookupFunctionInfo(FunctionIdentifier("dummyUDF"))
+    assert(expressionInfo.getClassName != null)

Review Comment:
   Can we replace null with the classname?



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