apache/seatunnel · warning

Skipping unsupported default value for column {} in table {}

Error message

Skipping unsupported default value for column {} in table {}. Using NULL constraint instead.

What it means

During schema evolution on a DM (Dameng) database, when a column has a default value written in a 'special' dialect-specific form (e.g. expression/current-timestamp defaults from the source dialect) that DM cannot represent, DmdbDialect.applySchemaChange skips the default value and appends only a NULL constraint, logging this warning. The column is added but without the original default, so inserts that relied on it may fail or produce different values.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/dm/DmdbDialect.java:245

                        .append(" ADD ")
                        .append(quoteIdentifier(column.getName()))
                        .append(" ")
                        .append(columnType);

        if (column.getDefaultValue() != null
                && !column.isNullable()
                && (sameCatalog
                        || !isSpecialDefaultValue(
                                typeDefine.getDefaultValue(), sourceDialectName))) {
            // Handle default values and null constraints
            String defaultValueClause = sqlClauseWithDefaultValue(typeDefine, sourceDialectName);
            sqlBuilder.append(" NOT NULL ").append(defaultValueClause);
        } else {
            // If the column is nullable or the default value is not supported,
            // the NULL constraint is added.
            if (column.getDefaultValue() != null
                    && isSpecialDefaultValue(typeDefine.getDefaultValue(), sourceDialectName)) {
                log.warn(
                        "Skipping unsupported default value for column {} in table {}. Using NULL constraint instead.",
                        column.getName(),
                        tablePath.getFullName());
            }
            sqlBuilder.append(" NULL");
        }
        ddlSQL.add(sqlBuilder.toString());

        // Process column comment
        if (column.getComment() != null) {
            ddlSQL.add(buildColumnCommentSQL(tablePath, column));
        }

        // Execute the DDL statement
        executeDDL(connection, ddlSQL);
    }

    @Override

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Add the column manually on DM with a DM-compatible DEFAULT (e.g. CURRENT_TIMESTAMP) before the event arrives
  2. Change the source column default to a portable literal both dialects support
  3. Make the column nullable without a default and set values in application code / a transform
  4. Extend/patch isSpecialDefaultValue handling in the DM dialect to translate the specific default expression

Example fix

// before (source DDL, MySQL)
ALTER TABLE t ADD COLUMN updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(6);
// after (DM-compatible default)
ALTER TABLE t ADD COLUMN updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NULL;
Defensive patterns

Strategy: validation

Validate before calling

// before applying schema change on DM
Column col = event.getColumn();
if (col.getDefaultValue() != null
        && isSpecialDefaultValue(col.getDefaultValue(), sourceDialectName)) {
    throw new IllegalArgumentException("Column " + col.getName()
        + " uses a default value unsupported by DM; add it manually with a DM-compatible DEFAULT");
}

Type guard

boolean hasPortableDefault(Column col) {
    String d = col.getDefaultValue();
    return d == null || !isSpecialDefaultValue(d, sourceDialectName);
}

Prevention

When it happens

Trigger: applySchemaChange builds ADD COLUMN DDL where column.getDefaultValue() != null and isSpecialDefaultValue(defaultValue, sourceDialectName) is true, and the column ends up on the nullable branch (so instead of embedding the unsupported default, it emits 'NULL').

Common situations: Cross-database schema sync (e.g. MySQL -> DM) where source defaults like CURRENT_TIMESTAMP(6), expression defaults, or driver-specific literals have no DM equivalent; schema evolution events carrying computed default values.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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