aokolnychyi commented on code in PR #8299:
URL: https://github.com/apache/iceberg/pull/8299#discussion_r1309295718
##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -81,6 +81,26 @@ public static TableMetadata newTableMetadata(
schema, spec, sortOrder, location, unreservedProperties(properties),
formatVersion);
}
+ public static TableMetadata newTableMetadataWithDefaultProperties(
+ Schema schema,
+ PartitionSpec spec,
+ SortOrder sortOrder,
+ String location,
+ Map<String, String> properties) {
+ Map<String, String> defaults = Maps.newHashMap();
+ defaults.put(
+ TableProperties.PARQUET_COMPRESSION,
+ TableProperties.PARQUET_COMPRESSION_DEFAULT_SINCE_1_4_0);
+ defaults.put(
+ TableProperties.DELETE_PARQUET_COMPRESSION,
+ TableProperties.PARQUET_COMPRESSION_DEFAULT_SINCE_1_4_0);
+ defaults.putAll(unreservedProperties(properties));
+ int formatVersion =
Review Comment:
I wonder whether we should add a method for fetching the format version, it
is used in 3 places now.
```
private static int formatVersion(Map<String, String> properties) {
return PropertyUtil.propertyAsInt(
properties, TableProperties.FORMAT_VERSION,
DEFAULT_TABLE_FORMAT_VERSION);
}
```
--
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]