danielcweeks commented on code in PR #15209:
URL: https://github.com/apache/iceberg/pull/15209#discussion_r2800046242


##########
kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/data/RecordConverter.java:
##########
@@ -81,11 +86,21 @@ class RecordConverter {
   private final NameMapping nameMapping;
   private final IcebergSinkConfig config;
   private final Map<Integer, Map<String, NestedField>> structNameMap = 
Maps.newHashMap();
+  private final int tableFormatVersion;
 
   RecordConverter(Table table, IcebergSinkConfig config) {
     this.tableSchema = table.schema();
     this.nameMapping = createNameMapping(table);
     this.config = config;
+
+    int formatVersion;
+    try {
+      formatVersion = TableUtil.formatVersion(table);
+    } catch (Exception ex) {
+      LOG.error("Failed to retrieve format version from table {}", 
table.name(), ex);
+      formatVersion = -1;
+    }
+    this.tableFormatVersion = formatVersion;

Review Comment:
   We don't need this try/catch block.  This is a runtime exception.



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