cloud-fan commented on a change in pull request #34303:
URL: https://github.com/apache/spark/pull/34303#discussion_r730975443



##########
File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSQLViewSuite.scala
##########
@@ -179,4 +181,24 @@ class HiveSQLViewSuite extends SQLViewSuite with 
TestHiveSingleton {
       }
     }
   }
+
+  test("SPARK-37018: Spark SQL should support create function with 
Aggregator") {
+    val avgFuncClass = "org.apache.spark.sql.hive.execution.MyDoubleAverage"
+    val functionName = "test_udf"
+    withTempDatabase { dbName =>
+      withUserDefinedFunction(
+        s"default.$functionName" -> false,
+        s"$dbName.$functionName" -> false,
+        functionName -> true) {
+        // create a function in default database
+        sql("USE DEFAULT")
+        sql(s"CREATE FUNCTION $functionName AS '$avgFuncClass'")

Review comment:
       can we do some basic test to make sure the function can be called? and 
with compatible input types to test implicit cast, incompatible input types to 
make sure the type check works.




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