amogh-jahagirdar commented on code in PR #9503:
URL: https://github.com/apache/iceberg/pull/9503#discussion_r1456949302


##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -90,10 +90,19 @@ private static Map<String, String> 
unreservedProperties(Map<String, String> rawP
   private static Map<String, String> persistedProperties(Map<String, String> 
rawProperties) {
     Map<String, String> persistedProperties = Maps.newHashMap();
 
+    String format =
+        rawProperties.getOrDefault(
+            TableProperties.DEFAULT_FILE_FORMAT, 
TableProperties.DEFAULT_FILE_FORMAT_DEFAULT);
+    String deleteFileFormat =
+        rawProperties.getOrDefault(TableProperties.DELETE_DEFAULT_FILE_FORMAT, 
format);
+
     // explicitly set defaults that apply only to new tables
-    persistedProperties.put(
-        TableProperties.PARQUET_COMPRESSION,
-        TableProperties.PARQUET_COMPRESSION_DEFAULT_SINCE_1_4_0);
+    if (format.equalsIgnoreCase(FileFormat.PARQUET.name())
+        || deleteFileFormat.equalsIgnoreCase(FileFormat.PARQUET.name())) {
+      persistedProperties.put(
+          TableProperties.PARQUET_COMPRESSION,
+          TableProperties.PARQUET_COMPRESSION_DEFAULT_SINCE_1_4_0);

Review Comment:
   I'm thinking there maybe a better pattern for these sorts of changes down 
the line. Some notion of version specific properties which will only be set on 
new tables based on the Iceberg version. But that idea is rather abstract at 
the moment and would require wider discussion.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to