aokolnychyi commented on a change in pull request #2887:
URL: https://github.com/apache/iceberg/pull/2887#discussion_r681976935
##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -57,31 +58,29 @@
private static final long ONE_MINUTE = TimeUnit.MINUTES.toMillis(1);
- /**
- * @deprecated will be removed in 0.9.0; use newTableMetadata(Schema,
PartitionSpec, String, Map) instead.
- */
- @Deprecated
- public static TableMetadata newTableMetadata(TableOperations ops,
- Schema schema,
- PartitionSpec spec,
- String location,
- Map<String, String> properties)
{
- return newTableMetadata(schema, spec, SortOrder.unsorted(), location,
properties, DEFAULT_TABLE_FORMAT_VERSION);
- }
-
public static TableMetadata newTableMetadata(Schema schema,
PartitionSpec spec,
SortOrder sortOrder,
String location,
Map<String, String> properties)
{
- return newTableMetadata(schema, spec, sortOrder, location, properties,
DEFAULT_TABLE_FORMAT_VERSION);
+ return newTableMetadata(schema, spec, sortOrder, location,
unreservedProperties(properties),
+ PropertyUtil.propertyAsInt(properties,
TableProperties.RESERVED_PROPERTY_FORMAT_VERSION,
+ DEFAULT_TABLE_FORMAT_VERSION));
}
public static TableMetadata newTableMetadata(Schema schema,
PartitionSpec spec,
String location,
Map<String, String> properties)
{
- return newTableMetadata(schema, spec, SortOrder.unsorted(), location,
properties, DEFAULT_TABLE_FORMAT_VERSION);
+ return newTableMetadata(schema, spec, SortOrder.unsorted(), location,
unreservedProperties(properties),
+ PropertyUtil.propertyAsInt(properties,
TableProperties.RESERVED_PROPERTY_FORMAT_VERSION,
Review comment:
nit: I think defining some helper variables will make it a little bit
easier to read. I usually try to avoid splitting code over multiple lines if
possible.
```
SortOrder sortOrder = SortOrder.unsorted();
int formatVersion = PropertyUtil.propertyAsInt(properties,
TableProperties.RESERVED_PROPERTY_FORMAT_VERSION,
DEFAULT_TABLE_FORMAT_VERSION);
return newTableMetadata(schema, spec, sortOrder, location,
unreservedProperties(properties), formatVersion);
```
--
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]