You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/01/04 03:18:00 UTC

[GitHub] [flink] wuchong commented on a change in pull request #14534: [FLINK-20822][hive] Don't check whether a function is generic in hive…

wuchong commented on a change in pull request #14534:
URL: https://github.com/apache/flink/pull/14534#discussion_r551095083



##########
File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
##########
@@ -1375,23 +1367,19 @@ public boolean functionExists(ObjectPath functionPath) throws CatalogException {
 
     private static Function instantiateHiveFunction(
             ObjectPath functionPath, CatalogFunction function) {
-
-        boolean isGeneric = function.isGeneric();
-
         // Hive Function does not have properties map
-        // thus, use a prefix in class name to distinguish Flink and Hive functions
+        // thus, use a prefix in class name to distinguish Java/Scala and Python functions
         String functionClassName;
-        if (function.getFunctionLanguage().equals(FunctionLanguage.JAVA)) {
-            functionClassName =
-                    isGeneric
-                            ? FLINK_FUNCTION_PREFIX + function.getClassName()
-                            : function.getClassName();
+        if (function.getFunctionLanguage() == FunctionLanguage.JAVA) {
+            functionClassName = function.getClassName();
+        } else if (function.getFunctionLanguage() == FunctionLanguage.SCALA) {

Review comment:
       Could we always use `==` operator or `equals` in the if branches here?

##########
File path: flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/table/catalog/hive/HiveCatalogGenericMetadataTest.java
##########
@@ -288,6 +293,45 @@ public void testTableSchemaCompatibility() throws Exception {
         }
     }
 
+    @Test
+    public void testFunctionCompatibility() throws Exception {
+        catalog.createDatabase(db1, createDb(), false);
+        catalog.createFunction(path1, new CatalogFunctionImpl("flink:class.name"), false);

Review comment:
       Is the `flink:` prefix valid? Will Flink framework add the prefix?




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