{"record":{"id":"00f5c6c31db6cef5","repo":"apache/iceberg","slug":"invalid-column-update-name","errorCode":null,"errorMessage":"Invalid column: ${update.name()}","messagePattern":"Invalid column: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/data/SchemaUtils.java","lineNumber":143,"sourceCode":"\n    // apply the updates\n    UpdateSchema updateSchema = table.updateSchema();\n    addColumns.forEach(\n        update -> updateSchema.addColumn(update.parentName(), update.name(), update.type()));\n    updateTypes.forEach(update -> updateSchema.updateColumn(update.name(), update.type()));\n    makeOptionals.forEach(update -> updateSchema.makeColumnOptional(update.name()));\n    updateSchema.commit();\n    LOG.info(\"Schema for table {} updated with new columns\", table.name());\n  }\n\n  private static boolean columnExists(org.apache.iceberg.Schema schema, AddColumn update) {\n    return schema.findType(update.key()) != null;\n  }\n\n  private static boolean typeMatches(org.apache.iceberg.Schema schema, UpdateType update) {\n    Type type = schema.findType(update.name());\n    if (type == null) {\n      throw new IllegalArgumentException(\"Invalid column: \" + update.name());\n    }\n    return type.typeId() == update.type().typeId();\n  }\n\n  private static boolean isOptional(org.apache.iceberg.Schema schema, MakeOptional update) {\n    NestedField field = schema.findField(update.name());\n    if (field == null) {\n      throw new IllegalArgumentException(\"Invalid column: \" + update.name());\n    }\n    return field.isOptional();\n  }\n\n  static PartitionSpec createPartitionSpec(\n      org.apache.iceberg.Schema schema, List<String> partitionBy) {\n    if (partitionBy.isEmpty()) {\n      return PartitionSpec.unpartitioned();\n    }\n","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/data/SchemaUtils.java#L125-L161","documentation":"SchemaUtils.updateTypes validates each requested UpdateType against the current Iceberg schema by looking up the column name. A null type means the column is absent, so an IllegalArgumentException 'Invalid column' is thrown before attempting the type update.","triggerScenarios":"Schema evolution handler applying column type updates from the Kafka topic schema to the Iceberg table when the renamed/missing column is not present in the table schema.","commonSituations":"Auto-evolution enabled but table manually altered/recreated; field renamed upstream; case mismatch between Connect field names and Iceberg field names.","solutions":["Ensure the table contains the column (recreate or ALTER TABLE ADD COLUMN).","Align field naming between the topic schema and Iceberg schema (e.g. recreate table with auto-create from current schema).","Disable evolution for that run or pre-sync schemas before enabling auto-evolution."],"exampleFix":"// before: topic has field 'ts' but table lacks it\nALTER TABLE db.target ADD COLUMN ts TIMESTAMP;\n// after: updateTypes finds the column and proceeds","handlingStrategy":"validation","validationCode":"UpdateType u = ...;\nif (schema.findType(u.name()) == null) {\n  throw new ConfigException(\"Column not in table: \" + u.name());\n}","typeGuard":null,"tryCatchPattern":"try { SchemaUtils.updateTypes(schema, updates); }\ncatch (IllegalArgumentException e) { LOG.error(\"evolution failed: {}\", e.getMessage()); throw e; }","preventionTips":["Keep table schema and topic schema in sync before enabling auto-evolution","Avoid renaming fields upstream without corresponding table changes","Log the schema diff when evolution errors occur"],"tags":["kafka-connect","schema-evolution","missing-column"],"backgroundTag":"resource-not-found","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"}