{"record":{"id":"3786f94e492ba985","repo":"apache/seatunnel","slug":"failed-to-alter-table-drop-column-sql","errorCode":null,"errorMessage":"Failed to alter table drop column, SQL:","messagePattern":"Failed to alter table drop column, SQL:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/schema/SchemaChangeManager.java","lineNumber":279,"sourceCode":"        switch (column.getDataType().getSqlType()) {\n            case STRING:\n            case BIGINT:\n            case INT:\n            case TIMESTAMP:\n                return true;\n            default:\n                return false;\n        }\n    }\n\n    public void applySchemaChange(TablePath tablePath, AlterTableDropColumnEvent event)\n            throws IOException {\n        String dropColumnSQL =\n                String.format(\n                        \"ALTER TABLE %s DROP COLUMN %s\",\n                        tablePath.getFullName(), quoteIdentifier(event.getColumn()));\n        if (!execute(dropColumnSQL, tablePath.getDatabaseName())) {\n            log.warn(\"Failed to alter table drop column, SQL:\" + dropColumnSQL);\n        }\n    }\n\n    /** execute sql in doris. */\n    public boolean execute(String ddl, String database)\n            throws IOException, IllegalArgumentException {\n        String responseEntity = executeThenReturnResponse(ddl, database);\n        return handleSchemaChange(responseEntity);\n    }\n\n    private String executeThenReturnResponse(String ddl, String database)\n            throws IOException, IllegalArgumentException {\n        if (StringUtils.isEmpty(ddl)) {\n            throw new IllegalArgumentException(\"ddl can not be null or empty string!\");\n        }\n        log.info(\"Execute SQL: {}\", ddl);\n        HttpPost httpPost = buildHttpPost(ddl, database);\n        return handleResponse(httpPost);","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/schema/SchemaChangeManager.java#L261-L297","documentation":"WARN log from SchemaChangeManager when ALTER TABLE ... DROP COLUMN fails to execute against Doris. execute() returned false and the code only logs instead of failing, so the drop event is silently dropped and Doris keeps the stale column. Means the requested DDL was rejected by the Doris FE.","triggerScenarios":"applySchemaChange handles a DropColumnEvent and builds 'ALTER TABLE <db>.<table> DROP COLUMN <col>'; execute() returns false — column does not exist, column is a key/index column, table is in a bad state, or FE/HTTP request failed.","commonSituations":"CDC source dropped a column that was already removed on Doris; trying to drop a Doris key column or a column used in bloom-filter index; FE auth/network errors; schema-change job already running on the table.","solutions":["Run the logged ALTER TABLE ... DROP COLUMN SQL manually on Doris to see the real rejection reason","Confirm the column exists and is droppable (not a key/index/bloom-filter column)","Wait for any in-progress Doris schema-change job to finish (SHOW ALTER TABLE COLUMN)","Verify FE connectivity and credentials","Consider upgrading to code that surfaces the HTTP error body instead of just the SQL"],"exampleFix":"// before\nif (!execute(dropColumnSQL, tablePath.getDatabaseName())) {\n    log.warn(\"Failed to alter table drop column, SQL:\" + dropColumnSQL);\n}\n// after\nif (!execute(dropColumnSQL, tablePath.getDatabaseName())) {\n    throw new IOException(\"Failed to alter table drop column, SQL:\" + dropColumnSQL);\n}","handlingStrategy":"validation","validationCode":"// confirm the column exists and is not a key/index column before dropping\nboolean exists = schemaChangeManager.columnExists(dropColumnEvent);\nif (!exists) { return; }\nSHOW CREATE TABLE db.table; -- verify droppable","typeGuard":null,"tryCatchPattern":"if (!schemaChangeManager.execute(dropColumnSQL, dbName)) {\n    throw new IOException(\"Doris rejected DDL: \" + dropColumnSQL);\n}","preventionTips":["Never configure Doris key/index columns for dropping","Wait for in-progress schema-change jobs before dropping","Run the DDL manually first to see the real rejection reason"],"tags":["doris","ddl","schema-change","sql"],"backgroundTag":"sql-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}