bowenli86 commented on a change in pull request #8353: [FLINK-12233][hive]
Support table related operations in HiveCatalog
URL: https://github.com/apache/flink/pull/8353#discussion_r282239896
##########
File path:
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/GenericHiveMetastoreCatalog.java
##########
@@ -363,4 +333,23 @@ public CatalogColumnStatistics
getPartitionColumnStatistics(ObjectPath tablePath
throw new UnsupportedOperationException();
}
+ // ------ utils ------
+
+ /**
+ * Filter out Hive-created properties, and return Flink-created
properties.
+ */
+ private Map<String, String> retrieveFlinkProperties(Map<String, String>
hiveTableParams) {
+ return hiveTableParams.entrySet().stream()
+ .filter(e ->
e.getKey().startsWith(FLINK_PROPERTY_PREFIX))
+ .collect(Collectors.toMap(e ->
e.getKey().replace(FLINK_PROPERTY_PREFIX, ""), e -> e.getValue()));
+ }
+
+ /**
+ * Add a prefix to Flink-created properties to distinguish them from
Hive-created properties.
+ */
+ private Map<String, String> buildFlinkProperties(Map<String, String>
properties) {
Review comment:
I feel "mask" is a good name. Not sure about "unmask" because the retrieval
not only unmasks flink properties but also filters out hive properties.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services