{"record":{"id":"504ccdee253d57a7","repo":"apache/seatunnel","slug":"columnnotexistexception","errorCode":null,"errorMessage":"ColumnNotExistException: {}","messagePattern":"ColumnNotExistException: (.+?)","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/catalog/PaimonCatalog.java","lineNumber":370,"sourceCode":"    }\n\n    // --------------------------------------------------------------------------------------------\n    // alterTable\n    // --------------------------------------------------------------------------------------------\n\n    public void alterTable(\n            Identifier identifier, SchemaChange schemaChange, boolean ignoreIfNotExists) {\n        try {\n            catalog.alterTable(identifier, schemaChange, ignoreIfNotExists);\n        } catch (org.apache.paimon.catalog.Catalog.TableNotExistException e) {\n            throw new TableNotExistException(\n                    this.catalogName,\n                    TablePath.of(identifier.getDatabaseName(), identifier.getTableName()),\n                    e);\n        } catch (org.apache.paimon.catalog.Catalog.ColumnAlreadyExistException e) {\n            throw new CatalogException(\"ColumnAlreadyExistException: {}\", e);\n        } catch (org.apache.paimon.catalog.Catalog.ColumnNotExistException e) {\n            throw new CatalogException(\"ColumnNotExistException: {}\", e);\n        }\n    }\n\n    public void alterTable(\n            Identifier identifier, List<SchemaChange> schemaChanges, boolean ignoreIfNotExists) {\n        try {\n            catalog.alterTable(identifier, schemaChanges, ignoreIfNotExists);\n        } catch (org.apache.paimon.catalog.Catalog.TableNotExistException e) {\n            throw new TableNotExistException(\n                    this.catalogName,\n                    TablePath.of(identifier.getDatabaseName(), identifier.getTableName()),\n                    e);\n        } catch (org.apache.paimon.catalog.Catalog.ColumnAlreadyExistException e) {\n            throw new CatalogException(\"ColumnAlreadyExistException: {}\", e);\n        } catch (org.apache.paimon.catalog.Catalog.ColumnNotExistException e) {\n            throw new CatalogException(\"ColumnNotExistException: {}\", e);\n        }\n    }","sourceCodeStart":352,"sourceCodeEnd":388,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/catalog/PaimonCatalog.java#L352-L388","documentation":"PaimonCatalog catches org.apache.paimon.catalog.Catalog.ColumnNotExistException during ALTER TABLE and rethrows it as CatalogException with the literal message \"ColumnNotExistException: {}\". It means a schema change referenced a column (e.g. RenameColumn, DropColumn, UpdateColumnType, UpdateColumnNullability) that does not exist in the table. The {} placeholder is never interpolated; the missing column name is only in the wrapped cause.","triggerScenarios":"Calling PaimonCatalog.alterTable(identifier, schemaChanges[, ignoreIfNotExists]) where the change list contains a RenameColumn/DropColumn/UpdateColumn* referring to a field absent from the target Paimon table's current schema.","commonSituations":"Replaying a DDL script against a table that was already modified; dropping/renaming a column that was removed by a previous job; case mismatch (\"Name\" vs \"name\") between the change and the schema; stale metadata cache after another process altered the table.","solutions":["Verify the column name against the current Paimon table schema and correct the spelling/case in the SchemaChange.","Remove obsolete changes from the DDL list, or filter out changes whose source field no longer exists before calling alterTable.","Use the alterTable overload with ignoreIfNotExists=true so non-existing column changes are skipped instead of failing.","Refresh/reopen the catalog to clear stale schema metadata."],"exampleFix":"// before\nchanges.add(SchemaChange.dropColumn(\"old_col\"));\ncatalog.alterTable(identifier, changes);\n// after\nif (existingFieldNames.contains(\"old_col\")) {\n    changes.add(SchemaChange.dropColumn(\"old_col\"));\n}\ncatalog.alterTable(identifier, changes, true);","handlingStrategy":"validation","validationCode":"Set<String> fields = catalog.getTable(identifier).fields().stream()\n        .map(DataField::name).collect(Collectors.toSet());\nchanges.removeIf(c -> referencesMissingField(c, fields));","typeGuard":null,"tryCatchPattern":"try {\n    catalog.alterTable(identifier, changes, true);\n} catch (CatalogException e) {\n    if (e.getCause() instanceof org.apache.paimon.catalog.Catalog.ColumnNotExistException) {\n        LOG.warn(\"referenced column missing, skipping change\");\n    } else { throw e; }\n}","preventionTips":["Always validate change targets against a freshly read table schema","Avoid replaying already-applied DDL scripts blindly","Match column names case-sensitively","Prefer the ignoreIfNotExists overload for retryable jobs"],"tags":["paimon","schema-evolution","missing-column","alter-table"],"backgroundTag":"resource-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}