You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "zhongyujiang (via GitHub)" <gi...@apache.org> on 2023/03/22 03:14:11 UTC

[GitHub] [iceberg] zhongyujiang commented on a diff in pull request #7153: Spark: Support loading function from session catalog in SparkSessionCatalog

zhongyujiang commented on code in PR #7153:
URL: https://github.com/apache/iceberg/pull/7153#discussion_r1144186882


##########
spark/v3.2/spark/src/test/java/org/apache/iceberg/spark/TestSparkSessionCatalog.java:
##########
@@ -86,4 +97,23 @@ public void testValidateHmsUri() {
             .defaultNamespace()[0]
             .equals("default"));
   }
+
+  @Test
+  public void testLoadFunction() {
+    spark.sessionState().catalogManager().reset();
+    spark.conf().set(envHmsUriKey, hmsUri);
+    spark.conf().set(catalogHmsUriKey, hmsUri);
+
+    String functionClass = "org.apache.hadoop.hive.ql.udf.generic.GenericUDFUpper";
+
+    // load permanent UDF in Hive via FunctionCatalog
+    spark.sql(String.format("CREATE FUNCTION upper AS '%s'", functionClass));

Review Comment:
   Spark has a build-in function also named `upper`. I think creating a existing function will not invoke `SparkSessionCatalog#loadFunction`, can you confirm that? 



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org