{"record":{"id":"5c62ab8f9282abb8","repo":"apache/seatunnel","slug":"skipping-unsupported-default-value-for-column-i","errorCode":null,"errorMessage":"Skipping unsupported default value for column {} in table {}. Using NULL constraint instead.","messagePattern":"Skipping unsupported default value for column (.+?) in table (.+?)\\. Using NULL constraint instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/dm/DmdbDialect.java","lineNumber":245,"sourceCode":"                        .append(\" ADD \")\n                        .append(quoteIdentifier(column.getName()))\n                        .append(\" \")\n                        .append(columnType);\n\n        if (column.getDefaultValue() != null\n                && !column.isNullable()\n                && (sameCatalog\n                        || !isSpecialDefaultValue(\n                                typeDefine.getDefaultValue(), sourceDialectName))) {\n            // Handle default values and null constraints\n            String defaultValueClause = sqlClauseWithDefaultValue(typeDefine, sourceDialectName);\n            sqlBuilder.append(\" NOT NULL \").append(defaultValueClause);\n        } else {\n            // If the column is nullable or the default value is not supported,\n            // the NULL constraint is added.\n            if (column.getDefaultValue() != null\n                    && isSpecialDefaultValue(typeDefine.getDefaultValue(), sourceDialectName)) {\n                log.warn(\n                        \"Skipping unsupported default value for column {} in table {}. Using NULL constraint instead.\",\n                        column.getName(),\n                        tablePath.getFullName());\n            }\n            sqlBuilder.append(\" NULL\");\n        }\n        ddlSQL.add(sqlBuilder.toString());\n\n        // Process column comment\n        if (column.getComment() != null) {\n            ddlSQL.add(buildColumnCommentSQL(tablePath, column));\n        }\n\n        // Execute the DDL statement\n        executeDDL(connection, ddlSQL);\n    }\n\n    @Override","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/dm/DmdbDialect.java#L227-L263","documentation":"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.","triggerScenarios":"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').","commonSituations":"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.","solutions":["Add the column manually on DM with a DM-compatible DEFAULT (e.g. CURRENT_TIMESTAMP) before the event arrives","Change the source column default to a portable literal both dialects support","Make the column nullable without a default and set values in application code / a transform","Extend/patch isSpecialDefaultValue handling in the DM dialect to translate the specific default expression"],"exampleFix":"// before (source DDL, MySQL)\nALTER TABLE t ADD COLUMN updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(6);\n// after (DM-compatible default)\nALTER TABLE t ADD COLUMN updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NULL;","handlingStrategy":"validation","validationCode":"// before applying schema change on DM\nColumn col = event.getColumn();\nif (col.getDefaultValue() != null\n        && isSpecialDefaultValue(col.getDefaultValue(), sourceDialectName)) {\n    throw new IllegalArgumentException(\"Column \" + col.getName()\n        + \" uses a default value unsupported by DM; add it manually with a DM-compatible DEFAULT\");\n}","typeGuard":"boolean hasPortableDefault(Column col) {\n    String d = col.getDefaultValue();\n    return d == null || !isSpecialDefaultValue(d, sourceDialectName);\n}","tryCatchPattern":null,"preventionTips":["Use portable literal defaults (constants) rather than dialect-specific expressions like CURRENT_TIMESTAMP(6)","Pre-create columns with DM-compatible defaults before schema evolution runs","Diff source and sink defaults after schema sync; this warning means the default was dropped","Keep app logic tolerant of NULL for newly added columns"],"tags":["jdbc","dm","schema-evolution","default-value"],"backgroundTag":"unsupported-operation","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}