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() != null

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Copy the SQL printed after 'Failed to alter table modify column, SQL:' and execute it manually on Doris to reveal the actual FE error.
  2. Check Doris FE logs for the DDL failure reason (type conflict, ongoing schema change, privilege).
  3. Grant ALTER privilege to the sink user and retry the pipeline.
  4. Align the table manually with ALTER TABLE ... MODIFY COLUMN ..., then restart from the latest checkpoint.
  5. 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

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


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/3137e748300e5071. Report an issue: GitHub.