apache/seatunnel · warning

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

Error message

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

What it means

When building ALTER TABLE ... ADD COLUMN SQL for Postgres, if a NOT NULL column has a default value that the connector cannot translate into the source dialect's SQL literal (isSpecialDefaultValue returns true and no mapping exists), it logs this warning and instead adds the column as NULL-able without the default. The schema change still proceeds but not exactly as requested.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/psql/PostgresDialect.java:402

                        .append("ALTER TABLE ")
                        .append(tableIdentifier(tablePath))
                        .append(" ADD ")
                        .append(quoteIdentifier(column.getName()))
                        .append(" ")
                        .append(columnType);
        if (column.getDefaultValue() == null) {
            sqlBuilder.append(" NULL");
        } else {
            if (column.isNullable()) {
                sqlBuilder.append(" NULL");
            } else if (sameCatalog
                    || !isSpecialDefaultValue(typeDefine.getDefaultValue(), sourceDialectName)) {
                sqlBuilder
                        .append(" NOT NULL")
                        .append(" ")
                        .append(sqlClauseWithDefaultValue(typeDefine, sourceDialectName));
            } else {
                log.warn(
                        "Skipping unsupported default value for column {} in table {}.",
                        column.getName(),
                        tablePath.getFullName());
                sqlBuilder.append(" NULL");
            }
        }
        return sqlBuilder.toString();
    }

    private List<String> buildUpdateColumnSQL(
            Connection connection, TablePath tablePath, AlterTableModifyColumnEvent event)
            throws SQLException {
        List<String> ddlSQl = new ArrayList<>();
        Column column = event.getColumn();
        String sourceDialectName = event.getSourceDialectName();
        boolean sameCatalog = StringUtils.equals(dialectName(), sourceDialectName);
        BasicTypeDefine typeDefine = getTypeConverter().reconvert(column);
        String columnType = sameCatalog ? column.getSourceType() : typeDefine.getColumnType();

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Translate the default value manually: run the ALTER TABLE with the appropriate Postgres default expression yourself instead of relying on auto schema evolution.
  2. Set the column to NULL-able in the schema change so the connector can add it cleanly, then apply the default separately.
  3. Check isSpecialDefaultValue/sqlClauseWithDefaultValue support for your default literal, or contribute/extend the dialect mapping for it.
  4. Avoid exotic default expressions on NOT NULL columns when synchronizing schema across dialects.

Example fix

// before: default 'NOW()' treated as special, column added as NULL
CatalogColumn.of("created_at", TimestampType(), true, "NOW()");
// after: apply default via explicit SQL or use a translatable literal
CatalogColumn.of("created_at", TimestampType(), false, null); // add column, then ALTER ... SET DEFAULT NOW()
Defensive patterns

Strategy: validation

Validate before calling

String dv = typeDefine.getDefaultValue();
if (typeDefine.isNotNull() && dv != null && isSpecialDefaultValue(dv, sourceDialectName)) {
    // add column as NULL-able or run explicit ALTER TABLE with translated default
}

Type guard

boolean hasTranslatableDefault(TypeDefine col, String dialect) {
    String dv = col.getDefaultValue();
    return dv == null || !isSpecialDefaultValue(dv, dialect);
}

Try / catch

try {
    applySchemaChange(change);
} catch (SQLException e) {
    log.warn("Schema change failed; check for columns skipped due to unsupported defaults", e);
}

Prevention

When it happens

Trigger: applySchemaChange -> buildAddColumnSQL with a column definition that is NOT NULL and whose defaultValue is classified as special/unsupported for sourceDialectName (e.g. complex expressions, function calls like CURRENT_TIMESTAMP variants, or dialect-specific literals).

Common situations: Schema-evolution sync between databases where the upstream default is an expression (e.g. NOW(), gen_random_uuid()) that the dialect translator does not map; cross-dialect auto schema evolution adding columns.

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/e721266751bf63e0. Report an issue: GitHub.