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 2019/08/14 23:12:43 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #25452: [SPARK-28710][SQL]to fix replace function, spark should call drop and create function

dongjoon-hyun commented on a change in pull request #25452: [SPARK-28710][SQL]to fix replace function, spark should call drop and create function
URL: https://github.com/apache/spark/pull/25452#discussion_r314122056
 
 

 ##########
 File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
 ##########
 @@ -2412,4 +2412,24 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils with TestHiveSingleton {
       }
     }
   }
+  test("SPARK-28710: Replace permanent function ") {
+    withUserDefinedFunction("customAdd" -> false) {
+      sql(
+        s"""
+           |CREATE FUNCTION customAdd
+           |AS 'org.apache.spark.sql.hive.execution.UDTFStack'
+           |USING JAR '${hiveContext.getHiveFile("SPARK-21101-1.0.jar").toURI}'
+        """.stripMargin)
+      val cnt =
+        sql("SELECT customAdd(2, 'A', 10, date '2015-01-01', 'B', 20, date '2016-01-01')").count()
+      assert(cnt === 2)
+      sql(
+        s"""
+           |CREATE or REPLACE FUNCTION customAdd
+           |AS 'org.apache.spark.examples.UDFAdd'
+           |USING JAR '${hiveContext.getHiveFile("SPARK-287101-1.0.jar").toURI}'
 
 Review comment:
   BTW, if possible, let's not add this new `jar` file. Could you use one of the existing file and add a comment instead?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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