Guosmilesmile commented on code in PR #16044:
URL: https://github.com/apache/iceberg/pull/16044#discussion_r3118700262


##########
flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/DynamicWriteResultAggregator.java:
##########
@@ -219,4 +220,12 @@ private PartitionSpec spec(String tableName, int specId) {
     Table table = catalog.loadTable(TableIdentifier.parse(tableName));
     return table.specs().get(specId);
   }
+
+  @Override
+  public void close() throws Exception {
+    super.close();
+    if (catalog instanceof Closeable) {
+      ((Closeable) catalog).close();
+    }

Review Comment:
   The same.



##########
flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/DynamicTableUpdateOperator.java:
##########
@@ -101,4 +103,12 @@ public DynamicRecordInternal map(DynamicRecordInternal 
data) throws Exception {
 
     return data;
   }
+
+  @Override
+  public void close() throws Exception {
+    super.close();
+    if (catalog instanceof Closeable) {
+      ((Closeable) catalog).close();
+    }

Review Comment:
   The same



##########
flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/DynamicRecordProcessor.java:
##########
@@ -215,5 +197,13 @@ public void close() {
     } catch (Exception e) {
       throw new RuntimeException(e);
     }
+
+    if (catalog instanceof Closeable) {
+      try {
+        ((Closeable) catalog).close();
+      } catch (Exception e) {
+        throw new RuntimeException(e);
+      }

Review Comment:
   Can we standardize on a single way of writing this? Found different style in 
1.20 vs 2.1
   
   ```
   if (catalog instanceof Closeable rs) 
   ```



-- 
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]

Reply via email to