{"record":{"id":"1eee2948635163e7","repo":"apache/iceberg","slug":"unknown-field-ordinal-i-1eee29","errorCode":null,"errorMessage":"Unknown field ordinal: ${i}","messagePattern":"Unknown field ordinal: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"kafka-connect/kafka-connect-events/src/main/java/org/apache/iceberg/connect/events/CommitComplete.java","lineNumber":112,"sourceCode":"        this.commitId = (UUID) v;\n        return;\n      case VALID_THROUGH_TS:\n        this.validThroughTs = v == null ? null : DateTimeUtil.timestamptzFromMicros((Long) v);\n        return;\n      default:\n        // ignore the object, it must be from a newer version of the format\n    }\n  }\n\n  @Override\n  public Object get(int i) {\n    switch (AvroUtil.positionToId(i, avroSchema)) {\n      case COMMIT_ID:\n        return commitId;\n      case VALID_THROUGH_TS:\n        return validThroughTs == null ? null : DateTimeUtil.microsFromTimestamptz(validThroughTs);\n      default:\n        throw new UnsupportedOperationException(\"Unknown field ordinal: \" + i);\n    }\n  }\n}\n","sourceCodeStart":94,"sourceCodeEnd":116,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/kafka-connect/kafka-connect-events/src/main/java/org/apache/iceberg/connect/events/CommitComplete.java#L94-L116","documentation":"CommitComplete is an Avro-record wrapper for the Kafka Connect commit event; its StructLike get(i) maps a field ordinal from the Avro schema to a field value (commitId or validThroughTs). If the ordinal doesn't match either known field, the code throws UnsupportedOperationException('Unknown field ordinal'). This means the Avro schema's field positions don't correspond to the expected event schema version.","triggerScenarios":"Reading a CommitComplete event whose Avro schema has different field ordering/extra fields than the reader expects — e.g. a producer writing a newer or older schema version, or a corrupted/mismatched schema in the schema registry or topic.","commonSituations":"Rolling upgrades where old producers write pre-COMMIT_ID-field events and new consumers read them; mixing iceberg kafka-connect versions across producers/consumers; manual schema edits changing field order.","solutions":["Align producer and consumer on the same kafka-connect-events schema version (upgrade both to the same Iceberg release).","Verify the topic/registry schema matches CommitComplete's Avro schema (COMMIT_ID, VALID_THROUGH_TS order).","Ensure the event payload wasn't written by a different event class or an incompatible Iceberg version.","If reading historical events from before the schema change, migrate or replay them with the old consumer version."],"exampleFix":"// before\n// consumer on iceberg 1.4 reading events produced by iceberg 1.5 schema\n// after\n// upgrade consumer dependency:\n// implementation 'org.apache.iceberg:iceberg-kafka-connect-events:1.5.0'","handlingStrategy":"try-catch","validationCode":"// verify producer/consumer schema agreement before deserializing\nSchema writerSchema = avroData.getSchema(event);\nif (writerSchema.getFields().size() != expectedCommitCompleteFields) {\n  throw new IllegalStateException(\"CommitComplete schema version mismatch\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  consumer.poll(...); // deserialize events\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().startsWith(\"Unknown field ordinal\")) {\n    log.error(\"Event schema version mismatch; upgrade iceberg-kafka-connect-events\", e);\n    // route to DLQ or replay with matching reader version\n  } else throw e;\n}","preventionTips":["Pin identical iceberg-kafka-connect-events versions on producers and consumers","Test rolling upgrades against events written by the previous version","Keep Avro schemas backward-compatible (append fields, don't reorder)","Validate event payloads in a staging topic before production rollout"],"tags":["kafka-connect","avro","schema","serialization"],"backgroundTag":"schema-version-mismatch","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}