{"record":{"id":"fcb999b280a9f2d5","repo":"apache/seatunnel","slug":"column-already-exists-in-table-skipping-cha-fcb999","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-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/util/SchemaUtils.java","lineNumber":78,"sourceCode":"    public static void applySchemaChange(\n            SchemaChangeEvent event, Connection connection, TablePath tablePath)\n            throws SQLException {\n        if (event instanceof AlterTableColumnsEvent) {\n            for (AlterTableColumnEvent columnEvent : ((AlterTableColumnsEvent) event).getEvents()) {\n                applySchemaChange(columnEvent, connection, tablePath);\n            }\n        } else {\n            if (event instanceof AlterTableChangeColumnEvent) {\n                AlterTableChangeColumnEvent changeColumnEvent = (AlterTableChangeColumnEvent) event;\n                if (!changeColumnEvent\n                        .getOldColumn()\n                        .equals(changeColumnEvent.getColumn().getName())) {\n                    if (!columnExists(connection, tablePath, changeColumnEvent.getOldColumn())\n                            && 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);","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/util/SchemaUtils.java#L60-L96","documentation":"While applying a schema-change (DDL) event like RenameColumn/ChangeColumn, the connector detected the target column name already exists in the StarRocks table while the old column does not. It logs this warning and skips the operation, treating the change as already applied (idempotent replay).","triggerScenarios":"applySchemaChange receives a change-column event whose new column already exists in the target table and the old column no longer does — typically the event was applied in a previous run and is being replayed.","commonSituations":"CDC job restarted from an earlier checkpoint; schema changes applied manually to StarRocks before the job; multiple jobs applying overlapping DDL.","solutions":["No action needed if the schema is already correct — the operation is safely skipped","If the skip is unexpected, compare target table schema (DESC table) with the event and reconcile manually","Ensure checkpoints/restore state are consistent so the same DDL event isn't repeatedly replayed"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// before applying, check target state yourself\nSHOW COLUMNS FROM <table> LIKE '<newColumn>';","typeGuard":null,"tryCatchPattern":"try {\n  schemaChangeHandler.applySchemaChange(event);\n} catch (Exception e) {\n  // skipped-due-to-existing-column is a benign warning; only retry on real failures\n  if (!e.getMessage().contains(\"already exists\")) throw e;\n}","preventionTips":["Make DDL handlers idempotent and treat 'already exists' skips as success","Avoid manual ALTERs on tables managed by CDC schema evolution","Restore jobs from consistent checkpoints to prevent DDL replay loops"],"tags":["schema-change","ddl","cdc","idempotency","starrocks"],"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"}