Aitozi commented on code in PR #21522:
URL: https://github.com/apache/flink/pull/21522#discussion_r1139678740
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/CatalogPropertiesUtil.java:
##########
@@ -91,16 +91,50 @@ public static Map<String, String>
serializeCatalogTable(ResolvedCatalogTable res
}
}
+ /** Serializes the given {@link ResolvedCatalogView} into a map of string
properties. */
+ public static Map<String, String> serializeCatalogView(ResolvedCatalogView
resolvedView) {
+ try {
+ final Map<String, String> properties = new HashMap<>();
+
+ serializeResolvedSchema(properties,
resolvedView.getResolvedSchema());
+
+ final String comment = resolvedView.getComment();
+ if (comment != null && comment.length() > 0) {
+ properties.put(COMMENT, comment);
+ }
+
+ properties.putAll(resolvedView.getOptions());
+
+ properties.remove(IS_GENERIC); // reserved option
+
+ return properties;
+ } catch (Exception e) {
+ throw new CatalogException("Error in serializing catalog view.",
e);
+ }
+ }
+
/** Deserializes the given map of string properties into an unresolved
{@link CatalogTable}. */
public static CatalogTable deserializeCatalogTable(Map<String, String>
properties) {
+ return deserializeCatalogTable(properties, null);
+ }
+
+ /** Deserializes the given map of string properties into an unresolved
{@link CatalogTable}. */
+ public static CatalogTable deserializeCatalogTable(
Review Comment:
updated
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]