{"record":{"id":"8687c68cd9ecade5","repo":"apache/seatunnel","slug":"column-already-exists-in-table-skipping-cha","errorCode":null,"errorMessage":"Column {} already exists in table {}. Skipping change column operation. event: {}","messagePattern":"Column (.+?) already exists in table (.+?)\\. Skipping change 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":107,"sourceCode":"        }\n    }\n\n    private void applySchemaChange(\n            Connection connection, TablePath tablePath, AlterTableColumnEvent event)\n            throws SQLException, IOException {\n        if (event instanceof AlterColumnCommentEvent) {\n            // Databend does not support comment synchronization, including nested column events.\n            log.info(\n                    \"Ignoring comment change event for table {} - Databend sink does not support comment sync: {}\",\n                    tablePath.getFullName(),\n                    event.getClass().getSimpleName());\n        } else if (event instanceof AlterTableChangeColumnEvent) {\n            AlterTableChangeColumnEvent changeColumnEvent = (AlterTableChangeColumnEvent) event;\n            if (!changeColumnEvent.getOldColumn().equals(changeColumnEvent.getColumn().getName())) {\n                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(),","sourceCodeStart":89,"sourceCodeEnd":125,"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#L89-L125","documentation":"Databend's SchemaChangeManager handles AlterTableChangeColumnEvent schema changes. When the old column does not exist but the new column name already exists in the table, the change (rename/modify) is considered already applied or conflicting, so it is skipped with this warning instead of failing. The schema change is a no-op.","triggerScenarios":"Applying a change-column event where target column name already exists and the source (old) column is gone — i.e., the rename was already performed (e.g. schema-change replay/at-least-once delivery, or two jobs applying the same CDC schema change).","commonSituations":"Replaying a CDC stream after a restart; multiple consumers applying the same DDL; manually renaming a column in Databend that the pipeline also renames.","solutions":["No action needed — the desired schema state already exists; confirm the column definition matches expectations","If it's a genuine conflict (different type/comment on the existing column), drop or alter the existing column manually and re-apply","Ensure schema-change events are applied once per pipeline to avoid duplicate DDL"],"exampleFix":"// before (duplicate application)\nALTER TABLE db.t RENAME COLUMN old TO new; -- run twice via replay\n// after — guard/skip when new column exists (connector does this automatically)","handlingStrategy":"retry","validationCode":"// Pre-check target state before applying change\nboolean oldExists = columnExists(conn, tablePath, oldName);\nboolean newExists = columnExists(conn, tablePath, newName);\nif (!oldExists && newExists) { /* already applied; skip */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Design schema-change handling to be idempotent (check-then-apply)","Deduplicate CDC DDL events upstream","Manually reconcile column definitions when replay is detected"],"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"}