{"record":{"id":"baf66bea4d434f78","repo":"apache/seatunnel","slug":"column-already-exists-in-table-skipping-add-baf66b","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-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/util/SchemaUtils.java","lineNumber":92,"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":74,"sourceCodeEnd":110,"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#L74-L110","documentation":"SchemaUtils.applySchemaChange logs this warning when an AlterTableAddColumnEvent arrives for a column that already exists in the StarRocks table. It checks with columnExists() before executing the ALTER TABLE ADD COLUMN statement, and if the column is already present it skips the DDL and returns instead of failing the schema-change synchronization. This makes add-column events idempotent across repeated deliveries.","triggerScenarios":"applySchemaChange(connection, tablePath, AlterTableAddColumnEvent) is called and columnExists(connection, tablePath, columnName) returns true — i.e. the target StarRocks table already has a column with the event's column name.","commonSituations":"Schema change events replayed after a checkpoint/job restart; the same add-column DDL was applied manually or by another sync tool (e.g. Flink CDC pipeline); duplicate events from upstream CDC because the source schema change was applied twice.","solutions":["No action required if the column already has the desired type — the operation is safely skipped.","Verify the existing column type in StarRocks (DESC <table>) matches the intended schema; if it differs, run a manual ALTER TABLE MODIFY COLUMN.","Check whether upstream CDC is re-emitting old schema-change events and deduplicate if replays are frequent."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before applying add-column event\ntry (Statement st = connection.createStatement();\n     ResultSet rs = st.executeQuery(\"DESC \" + tablePath.getFullName())) {\n    while (rs.next()) {\n        if (rs.getString(\"Field\").equalsIgnoreCase(addColumnEvent.getColumn().getName())) {\n            return; // already exists, skip\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat add-column warnings as idempotent skip, not failure","Compare existing column types with the event schema after each skip","Deduplicate CDC schema-change events before applying"],"tags":["starrocks","schema-change","idempotency"],"backgroundTag":"column-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"}