{"record":{"id":"16db1bac39552ba0","repo":"apache/seatunnel","slug":"column-already-exists-in-table-skipping-add-16db1b","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":"info","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/JdbcDialect.java","lineNumber":542,"sourceCode":"                            && columnExists(\n                                    connection,\n                                    tablePath,\n                                    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                }\n                applySchemaChange(connection, tablePath, changeColumnEvent);\n            } else if (event instanceof AlterTableModifyColumnEvent) {\n                applySchemaChange(connection, tablePath, (AlterTableModifyColumnEvent) event);\n            } else if (event instanceof AlterTableAddColumnEvent) {\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                applySchemaChange(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                applySchemaChange(connection, tablePath, dropColumnEvent);","sourceCodeStart":524,"sourceCodeEnd":560,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/JdbcDialect.java#L524-L560","documentation":"When applying an AlterTableAddColumnEvent, JdbcDialect first checks columnExists(); if the column is already present the DDL is skipped and this warning is logged. This makes add-column schema evolution idempotent across restarts and replays.","triggerScenarios":"applySchemaChange receives an AlterTableAddColumnEvent for a column that already exists in the target table (duplicate or already-applied event).","commonSituations":"Task restart/replay of schema change events; upstream resends the same add-column; another job already added the column; name collision with an existing column.","solutions":["Benign if the column already matches the desired schema — no action required","If column exists with a different type than intended, alter it manually or via a modify-column event","Check upstream for duplicate schema-change event emission (multiple writers, replay after restart)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// check before emitting add-column DDL\nif (columnExists(conn, tablePath, columnName)) {\n    log.info(\"column already exists; skip ADD COLUMN\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Guard all DDL with existence checks (idempotent migrations)","Ensure only one job owns schema evolution for a table","Watch for case-sensitivity differences in column identifiers"],"tags":["schema-evolution","jdbc","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"}