danny0405 commented on a change in pull request #11791: URL: https://github.com/apache/flink/pull/11791#discussion_r414269563
########## File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java ########## @@ -247,7 +253,10 @@ public CatalogDatabase getDatabase(String databaseName) throws DatabaseNotExistE Map<String, String> properties = hiveDatabase.getParameters(); - properties.put(HiveCatalogConfig.DATABASE_LOCATION_URI, hiveDatabase.getLocationUri()); + boolean isGeneric = getObjectIsGeneric(properties); + if (!isGeneric) { + properties.put(SqlCreateHiveDatabase.DATABASE_LOCATION_URI, hiveDatabase.getLocationUri()); + } Review comment: We usually put the properties key in the connector validator instead of the SqlNode, i think. ########## File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java ########## @@ -1403,4 +1446,29 @@ public CatalogColumnStatistics getPartitionColumnStatistics(ObjectPath tablePath } } + private static boolean createObjectIsGeneric(Map<String, String> properties) { + // When creating an object, a hive object needs explicitly have a key is_generic = false Review comment: How about name it `getObjectIsGenericDefaultTrue` ---------------------------------------------------------------- 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: us...@infra.apache.org