{"record":{"id":"456361b0fc0b9871","repo":"apache/seatunnel","slug":"column-already-exists-in-table-skipping-add","errorCode":null,"errorMessage":"Column {} already exists in table {}. Skipping add column operation. event: {}","messagePattern":"Column (.+?) already exists in table (.+?)\\. Skipping add column operation\\. event: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-databend/src/main/java/org/apache/seatunnel/connectors/seatunnel/databend/schema/SchemaChangeManager.java","lineNumber":122,"sourceCode":"                if (!columnExists(connection, tablePath, changeColumnEvent.getOldColumn())\n                        && columnExists(\n                                connection, tablePath, changeColumnEvent.getColumn().getName())) {\n                    log.warn(\n                            \"Column {} already exists in table {}. Skipping change column operation. event: {}\",\n                            changeColumnEvent.getColumn().getName(),\n                            tablePath.getFullName(),\n                            event);\n                    return;\n                }\n                applyRenameColumn(connection, tablePath, changeColumnEvent);\n            }\n        } else if (event instanceof AlterTableModifyColumnEvent) {\n            applyModifyColumn(connection, tablePath, (AlterTableModifyColumnEvent) event);\n        } else if (event instanceof AlterTableAddColumnEvent) {\n            // handle column\n            AlterTableAddColumnEvent addColumnEvent = (AlterTableAddColumnEvent) event;\n            if (columnExists(connection, tablePath, addColumnEvent.getColumn().getName())) {\n                log.warn(\n                        \"Column {} already exists in table {}. Skipping add column operation. event: {}\",\n                        addColumnEvent.getColumn().getName(),\n                        tablePath.getFullName(),\n                        event);\n                return;\n            }\n            applyAddColumn(connection, tablePath, addColumnEvent);\n        } else if (event instanceof AlterTableDropColumnEvent) {\n            AlterTableDropColumnEvent dropColumnEvent = (AlterTableDropColumnEvent) event;\n            if (!columnExists(connection, tablePath, dropColumnEvent.getColumn())) {\n                log.warn(\n                        \"Column {} does not exist in table {}. Skipping drop column operation. event: {}\",\n                        dropColumnEvent.getColumn(),\n                        tablePath.getFullName(),\n                        event);\n                return;\n            }\n            applyDropColumn(connection, tablePath, dropColumnEvent);","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-databend/src/main/java/org/apache/seatunnel/connectors/seatunnel/databend/schema/SchemaChangeManager.java#L104-L140","documentation":"Databend's SchemaChangeManager handles AlterTableAddColumnEvent. If the column to add already exists in the target table, the add operation is skipped with this warning rather than throwing, making the DDL idempotent. The event is a no-op.","triggerScenarios":"Applying an add-column event for a column name that already exists in the Databend table — typically due to event replay, at-least-once schema-change delivery, or the column being added manually beforehand.","commonSituations":"CDC pipelines replaying schema change events after restart; concurrent pipelines applying the same DDL; users pre-creating the column in Databend.","solutions":["No action needed if the existing column matches the event's definition — the schema is already correct","Verify the existing column's type/nullability matches the event; if different, alter it manually to align","Deduplicate schema-change events or make delivery exactly-once if duplicate DDL noise is a problem"],"exampleFix":"// before\n-- replayed: ALTER TABLE db.t ADD COLUMN extra STRING; (column already there)\n// after — connector skips automatically; ensure event dedup upstream if noisy","handlingStrategy":"retry","validationCode":"// Pre-check before applying add column\nif (columnExists(conn, tablePath, columnName)) { /* already applied; skip */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat add-column DDL as idempotent; always check existence first","Deduplicate replayed schema-change events","Align column types when the pre-existing column differs from the event"],"tags":["databend","schema-change","idempotency","ddl"],"backgroundTag":"file-already-exists","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}