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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala:
##########
@@ -49,8 +49,10 @@ trait FunctionRegistryBase[T] {
 
   final def registerFunction(
       name: FunctionIdentifier, builder: FunctionBuilder, source: String): 
Unit = {
+    var builderClassName = builder.getClass.getCanonicalName

Review Comment:
   I adopted the Option one liner suggested by @zhenlineo 



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

Review Comment:
   sure



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