dejii commented on code in PR #38149:
URL: https://github.com/apache/beam/pull/38149#discussion_r3075022050
##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/AppendFilesToTables.java:
##########
@@ -251,5 +252,12 @@ private boolean shouldSkip(Table table,
Iterable<FileWriteResult> fileWriteResul
}
return false;
}
+
+ @Teardown
+ public void teardown() throws IOException {
+ if (catalog instanceof Closeable) {
+ ((Closeable) catalog).close();
Review Comment:
`cachedCatalog` is `transient`, so it's not serialized. Each DoFn gets its
own `IcebergCatalogConfig` instance with `cachedCatalog = null` on
deserialization. No sharing across transforms at execution time, so closing one
DoFn's catalog cannot affect another.
https://github.com/apache/beam/blob/53f8367adf658c231bbcab6ebbcba620c4b30659/sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/IcebergCatalogConfig.java#L57
--
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]