kbendick commented on code in PR #5437:
URL: https://github.com/apache/iceberg/pull/5437#discussion_r938264291
##########
aws/src/main/java/org/apache/iceberg/aws/glue/GlueCatalog.java:
##########
@@ -210,25 +211,24 @@ void initialize(
protected TableOperations newTableOps(TableIdentifier tableIdentifier) {
if (catalogProperties != null) {
Map<String, String> tableSpecificCatalogProperties =
- ImmutableMap.<String, String>builder()
- .putAll(catalogProperties)
- .put(
- AwsProperties.LAKE_FORMATION_DB_NAME,
- IcebergToGlueConverter.getDatabaseName(
- tableIdentifier,
awsProperties.glueCatalogSkipNameValidation()))
- .put(
- AwsProperties.LAKE_FORMATION_TABLE_NAME,
- IcebergToGlueConverter.getTableName(
- tableIdentifier,
awsProperties.glueCatalogSkipNameValidation()))
- .build();
+ Maps.newHashMapWithExpectedSize(catalogProperties.size() + 2);
+ tableSpecificCatalogProperties.putAll(catalogProperties);
+ tableSpecificCatalogProperties.put(
+ AwsProperties.LAKE_FORMATION_DB_NAME,
+ IcebergToGlueConverter.getDatabaseName(
+ tableIdentifier, awsProperties.glueCatalogSkipNameValidation()));
+ tableSpecificCatalogProperties.put(
+ AwsProperties.LAKE_FORMATION_TABLE_NAME,
+ IcebergToGlueConverter.getTableName(
+ tableIdentifier, awsProperties.glueCatalogSkipNameValidation()));
// FileIO initialization depends on tableSpecificCatalogProperties, so a
new FileIO is
// initialized each time
return new GlueTableOperations(
glue,
lockManager,
catalogName,
awsProperties,
- initializeFileIO(tableSpecificCatalogProperties),
+
initializeFileIO(Collections.unmodifiableMap(tableSpecificCatalogProperties)),
Review Comment:
To test this, you could do `newTableOps` on a `GlueCatalog` and then ensure
that the resulting `FileIO` can be round trip serialized through Kryo (which
there's a helper method for I believe).
That way it won't be refactored back to `ImmutableMap`.
--
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]