Skip to content

Commit 5235f9b

Browse files
committed
fix
1 parent 50d09c7 commit 5235f9b

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/RecordWriterManager.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkArgument;
2121
import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkState;
2222

23-
import java.io.Closeable;
2423
import java.io.IOException;
2524
import java.time.Duration;
2625
import java.time.Instant;
@@ -441,10 +440,10 @@ public void close() throws IOException {
441440
Set<FileIO> closedIOs = new HashSet<>();
442441
for (DestinationState state : destinations.values()) {
443442
FileIO io = state.table.io();
444-
if (io instanceof Closeable && closedIOs.add(io)) {
443+
if (io != null && closedIOs.add(io)) {
445444
try {
446-
((Closeable) io).close();
447-
} catch (IOException e) {
445+
io.close();
446+
} catch (Exception e) {
448447
LOG.warn("Failed to close FileIO for table '{}'", state.table.name(), e);
449448
}
450449
}

0 commit comments

Comments
 (0)