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 2020/04/26 03:16:00 UTC

[GitHub] [flink] JingsongLi commented on a change in pull request #11791: [FLINK-17210][sql-parser][hive] Implement database DDLs for Hive dialect

JingsongLi commented on a change in pull request #11791:
URL: https://github.com/apache/flink/pull/11791#discussion_r415200864



##########
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
+		// otherwise, this is a generic object if 1) the key is missing 2) is_generic = true
+		// this is opposite to reading an object. See getObjectIsGeneric().
+		if (properties == null) {
+			return true;
+		}
+		boolean isGeneric;
+		if (!properties.containsKey(CatalogConfig.IS_GENERIC)) {
+			// must be a generic object
+			isGeneric = true;
+			properties.put(CatalogConfig.IS_GENERIC, String.valueOf(true));
+		} else {
+			isGeneric = Boolean.parseBoolean(properties.get(CatalogConfig.IS_GENERIC));
+		}
+		return isGeneric;
+	}
+
+	private static boolean getObjectIsGeneric(Map<String, String> properties) {
+		// When retrieving an object, a generic object needs explicitly have a key is_generic = true

Review comment:
       +1
   There is two default value between `getXX` and `createXX` in catalog.




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