apache/seatunnel · warning
Failed to alter table modify column, SQL:
Error message
Failed to alter table modify column, SQL:
What it means
This WARN is logged when the ALTER TABLE ... MODIFY COLUMN SQL (changing a column's type/comment/position) fails to execute against Doris — execute() returned false. Like the CHANGE COLUMN case, the failure is only warned: the pipeline continues, but the Doris schema diverges from the source, usually causing subsequent data writes to fail or be silently coerced.
Source
Thrown at seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/schema/SchemaChangeManager.java:211
.append(" ")
.append(quoteIdentifier(event.getColumn().getName()))
.append(" ")
.append(typeDefine.getColumnType());
if (event.getColumn().getComment() != null) {
sqlBuilder
.append(" ")
.append("COMMENT ")
.append("'")
.append(event.getColumn().getComment())
.append("'");
}
if (event.getAfterColumn() != null) {
sqlBuilder.append(" ").append("AFTER ").append(quoteIdentifier(event.getAfterColumn()));
}
String modifyColumnSQL = sqlBuilder.toString();
if (!execute(modifyColumnSQL, tablePath.getDatabaseName())) {
log.warn("Failed to alter table modify column, SQL:" + modifyColumnSQL);
}
}
public void applySchemaChange(TablePath tablePath, AlterTableAddColumnEvent event)
throws IOException {
BasicTypeDefine typeDefine = DorisTypeConverterV2.INSTANCE.reconvert(event.getColumn());
StringBuilder sqlBuilder =
new StringBuilder()
.append("ALTER TABLE")
.append(" ")
.append(tablePath.getFullName())
.append(" ")
.append("ADD COLUMN")
.append(" ")
.append(quoteIdentifier(event.getColumn().getName()))
.append(" ")
.append(typeDefine.getColumnType());
if (event.getColumn().getDefaultValue() != nullView on GitHub (pinned to cf67b549a7)
Solutions
- Copy the SQL printed after 'Failed to alter table modify column, SQL:' and execute it manually on Doris to reveal the actual FE error.
- Check Doris FE logs for the DDL failure reason (type conflict, ongoing schema change, privilege).
- Grant ALTER privilege to the sink user and retry the pipeline.
- Align the table manually with ALTER TABLE ... MODIFY COLUMN ..., then restart from the latest checkpoint.
- If Doris cannot support the source type change, adjust the upstream schema or fix the column type mapping (DorisTypeConverterV2) and rebuild.
Example fix
// before: failure only warned, pipeline continues with stale schema
String modifyColumnSQL = sqlBuilder.toString();
if (!execute(modifyColumnSQL, tablePath.getDatabaseName())) {
log.warn("Failed to alter table modify column, SQL:" + modifyColumnSQL);
}
// after: propagate the failure so the job retries/alerts
if (!execute(modifyColumnSQL, tablePath.getDatabaseName())) {
throw new IOException("Failed to alter table modify column, SQL: " + modifyColumnSQL);
} Defensive patterns
Strategy: try-catch
Validate before calling
// Validate target type compatibility before the event is applied DESC db.tbl; -- check current type; confirm Doris supports the new type SHOW GRANTS FOR 'seatunnel_user'; -- require ALTER_PRIV curl http://<fe-host>:<http-port>/api/bootstrap -- FE reachable
Try / catch
try {
schemaManager.applySchemaChange(tablePath, modifyColumnEvent);
} catch (Exception e) {
LOG.error("Doris MODIFY COLUMN failed for " + tablePath + ", SQL: " + modifyColumnSQL, e);
throw e;
} Prevention
- Manually execute the logged ALTER ... MODIFY COLUMN SQL to surface the underlying FE error.
- Avoid narrowing type changes upstream that Doris cannot MODIFY (e.g. int -> tinyint).
- Ensure ALTER privileges for the sink account.
- Do not run multiple schema-change operations on the same table simultaneously (Doris rejects conflicting schema changes).
- Pin test coverage for DorisTypeConverterV2 mappings used by your source types.
When it happens
Trigger: execute(modifyColumnSQL, database) returns false when applySchemaChange processes an AlterTableModifyColumnEvent — Doris rejects the DDL due to an unsupported target type from DorisTypeConverterV2.reconvert, incompatible type narrowing, nonexistent column, FE connectivity issues, or missing ALTER privilege.
Common situations: Upstream widened/changed a column type that Doris's converter maps to something Doris rejects in this context; user lacks ALTER rights; FE HTTP endpoint down or returning error; another schema-change job is running on the table so the new ALTER conflicts; Doris version doesn't support the requested type modification.
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 change column, SQL:
- SCHEMA_CHANGE_FAILED
- Failed to alter table add column, SQL:
- Failed to alter table drop column, SQL:
- SQL_OPERATION_FAILED
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/3137e748300e5071.
Report an issue: GitHub.