rdblue commented on a change in pull request #2887:
URL: https://github.com/apache/iceberg/pull/2887#discussion_r680573814
##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -679,10 +700,23 @@ private TableMetadata setCurrentSnapshotTo(Snapshot
snapshot) {
public TableMetadata replaceProperties(Map<String, String> newProperties) {
ValidationException.check(newProperties != null, "Cannot set properties to
null");
- return new TableMetadata(null, formatVersion, uuid, location,
+ Map<String, String> validProperties = newProperties;
+ int newFormatVersion = formatVersion;
+ if (newProperties.containsKey(PROPERTY_FORMAT_VERSION)) {
+ validProperties = Maps.newHashMap(newProperties);
+ newFormatVersion =
Integer.parseInt(validProperties.remove(PROPERTY_FORMAT_VERSION));
+ }
Review comment:
We also already have `PropertyUtil` that you can use to make this one
line.
--
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]