mxm commented on code in PR #16044:
URL: https://github.com/apache/iceberg/pull/16044#discussion_r3146661203
##########
flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/TableSerializerCache.java:
##########
@@ -120,9 +134,14 @@ private class SerializerInfo {
}
private void update() {
- Table table =
catalogLoader.loadCatalog().loadTable(TableIdentifier.parse(tableName));
- schemas = table.schemas();
- specs = table.specs();
+ Catalog loadedCatalog = catalogLoader.loadCatalog();
+ try {
+ Table table =
loadedCatalog.loadTable(TableIdentifier.parse(tableName));
+ schemas = table.schemas();
+ specs = table.specs();
+ } finally {
+ closeCatalog(loadedCatalog);
Review Comment:
This is a different pattern than in the other classes, i.e. we are closing
immediately after using the catalog. Should we also follow that approach
elsewhere? Do we need a cache to avoid the overhead of opening / closing?
--
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]