You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/12/27 00:58:47 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #34352: [SPARK-37018][SQL] Spark SQL should support create function with Aggregator

HyukjinKwon commented on a change in pull request #34352:
URL: https://github.com/apache/spark/pull/34352#discussion_r775302106



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/UDFSuite.scala
##########
@@ -848,6 +867,37 @@ class UDFSuite extends QueryTest with SharedSparkSession {
     }
   }
 
+  test("SPARK-37018: Spark SQL should support create function with Aggregator") {
+    val avgFuncClass = "org.apache.spark.sql.MyDoubleAverage"
+    val avgFunction = "my_avg"
+    val sumFuncClass = "org.apache.spark.sql.MyDoubleSum"
+    val sumFunction = "my_sum"
+    withTempDatabase { dbName =>
+      withUserDefinedFunction(
+        s"default.$avgFunction" -> false,
+        s"default.$sumFunction" -> false,
+        s"$dbName.$avgFunction" -> false,
+        s"$dbName.$sumFunction" -> false,
+        avgFunction -> true,
+        sumFunction -> true) {

Review comment:
       sorry but a nit:
   
   ```suggestion
             s"default.$avgFunction" -> false,
             s"default.$sumFunction" -> false,
             s"$dbName.$avgFunction" -> false,
             s"$dbName.$sumFunction" -> false,
             avgFunction -> true,
             sumFunction -> true) {
   ```
   
   




-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org