wuchong commented on a change in pull request #11047: [FLINK-15912][table] Add 
Context to TableSourceFactory and TableSinkFactory
URL: https://github.com/apache/flink/pull/11047#discussion_r379999056
 
 

 ##########
 File path: 
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/CatalogTableImpl.java
 ##########
 @@ -81,4 +81,31 @@ public CatalogBaseTable copy() {
 
                return descriptor.asMap();
        }
+
+       /**
+        * Construct a {@link CatalogTableImpl} from complete properties that 
contains table schema.
+        */
+       public static CatalogTableImpl fromProperties(Map<String, String> 
properties) {
+               Map<String, String> newProperties = new HashMap<>(properties);
+               TableSchema tableSchema = getSchema(newProperties);
+               
schemaToProperties(tableSchema).keySet().forEach(newProperties::remove);
 
 Review comment:
   I think we can add a method to `DescriptorProperties#removeKeyPrefix(String 
prefix)` to drop schema properties. This can also be used in other place. 

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

Reply via email to