rdblue commented on a change in pull request #4011:
URL: https://github.com/apache/iceberg/pull/4011#discussion_r795267170



##########
File path: api/src/main/java/org/apache/iceberg/catalog/Catalog.java
##########
@@ -388,6 +392,59 @@ default TableBuilder buildTable(TableIdentifier 
identifier, Schema schema) {
   default void initialize(String name, Map<String, String> properties) {
   }
 
+  /**
+   * Get catalog properties.
+   *
+   * @return catalog properties
+   */
+  Map<String, String> properties();
+
+  /**
+   * Get default table properties set at Catalog level through catalog 
properties.
+   *
+   * @return default table properties specified in catalog properties
+   */
+  default Map<String, String> tableCreateDefaultProperties() {
+    String tableCreateDefaultPrefix = "table.create.default.";
+    Map<String, String> props = properties() == null ? Collections.emptyMap() 
: properties();
+
+    return props.entrySet().stream()
+        .filter(e -> 
e.getKey().toLowerCase(Locale.ROOT).startsWith(tableCreateDefaultPrefix))
+        .collect(Collectors.toMap(e -> 
e.getKey().replace(tableCreateDefaultPrefix, ""),
+            Map.Entry::getValue));
+  }
+
+  /**
+   * Get table properties that are enforced at Catalog level through catalog 
properties.
+   *
+   * @return default table properties enforced through catalog properties
+   */
+  default Map<String, String> tableCreateEnforcedProperties() {
+    String tableCreateEnforcedPrefix = "table.create.enforced.";

Review comment:
       I think we need a better name for this. This is really long and will be 
embedded in nested configs (for Spark) and will contain nested configs.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to