You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "bryanck (via GitHub)" <gi...@apache.org> on 2026/03/16 14:52:22 UTC

Re: [PR] KafkaConnect: Fix Nested schema evolution [iceberg]

bryanck commented on code in PR #15396:
URL: https://github.com/apache/iceberg/pull/15396#discussion_r2940889399


##########
kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/data/SchemaUtils.java:
##########
@@ -126,8 +128,20 @@ private static void commitSchemaUpdates(Table table, SchemaUpdate.Consumer updat
         update -> updateSchema.addColumn(update.parentName(), update.name(), update.type()));
     updateTypes.forEach(update -> updateSchema.updateColumn(update.name(), update.type()));
     makeOptionals.forEach(update -> updateSchema.makeColumnOptional(update.name()));
-    updateSchema.commit();
-    LOG.info("Schema for table {} updated with new columns", table.name());
+    try {
+      updateSchema.commit();
+      LOG.info("Schema for table {} updated with new columns", table.name());
+    } catch (ValidationException | CommitFailedException e) {
+      // this can happen if the field already exists in the table, which is fine (other task
+      // committed the schema). No action required

Review Comment:
   These exceptions could be caused for other reasons as well, and thus we could lose data if we ignore the schema update in those cases.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org