apache/seatunnel · warning
Failed to alter table drop column, SQL:
Error message
Failed to alter table drop column, SQL:
What it means
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.
Source
Thrown at seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/schema/SchemaChangeManager.java:279
switch (column.getDataType().getSqlType()) {
case STRING:
case BIGINT:
case INT:
case TIMESTAMP:
return true;
default:
return false;
}
}
public void applySchemaChange(TablePath tablePath, AlterTableDropColumnEvent event)
throws IOException {
String dropColumnSQL =
String.format(
"ALTER TABLE %s DROP COLUMN %s",
tablePath.getFullName(), quoteIdentifier(event.getColumn()));
if (!execute(dropColumnSQL, tablePath.getDatabaseName())) {
log.warn("Failed to alter table drop column, SQL:" + dropColumnSQL);
}
}
/** execute sql in doris. */
public boolean execute(String ddl, String database)
throws IOException, IllegalArgumentException {
String responseEntity = executeThenReturnResponse(ddl, database);
return handleSchemaChange(responseEntity);
}
private String executeThenReturnResponse(String ddl, String database)
throws IOException, IllegalArgumentException {
if (StringUtils.isEmpty(ddl)) {
throw new IllegalArgumentException("ddl can not be null or empty string!");
}
log.info("Execute SQL: {}", ddl);
HttpPost httpPost = buildHttpPost(ddl, database);
return handleResponse(httpPost);View on GitHub (pinned to cf67b549a7)
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
Example fix
// before
if (!execute(dropColumnSQL, tablePath.getDatabaseName())) {
log.warn("Failed to alter table drop column, SQL:" + dropColumnSQL);
}
// after
if (!execute(dropColumnSQL, tablePath.getDatabaseName())) {
throw new IOException("Failed to alter table drop column, SQL:" + dropColumnSQL);
} Defensive patterns
Strategy: validation
Validate before calling
// confirm the column exists and is not a key/index column before dropping
boolean exists = schemaChangeManager.columnExists(dropColumnEvent);
if (!exists) { return; }
SHOW CREATE TABLE db.table; -- verify droppable Try / catch
if (!schemaChangeManager.execute(dropColumnSQL, dbName)) {
throw new IOException("Doris rejected DDL: " + dropColumnSQL);
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "query failed", "%w: SQL error" — wrapped database query errors in Go libraries explained — this error's family across 3 libraries.
Related errors
- Failed to alter table add column, SQL:
- SQL_OPERATION_FAILED
- SCHEMA_CHANGE_FAILED
- Failed to alter table change column, SQL:
- Failed to alter table modify column, SQL:
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/3786f94e492ba985.
Report an issue: GitHub.