{"record":{"id":"0ad38654e71a9835","repo":"apache/seatunnel","slug":"default-value-is-not-supported-for-column-in-ta","errorCode":null,"errorMessage":"Default value is not supported for column {} in table {}. Skipping add column operation. event: {}","messagePattern":"Default value is not supported for column (.+?) in table (.+?)\\. Skipping add column operation\\. event: (.+?)","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/JdbcDialect.java","lineNumber":625,"sourceCode":"                        .append(tableIdentifier(tablePath))\n                        .append(\" \")\n                        .append(\"ADD COLUMN\")\n                        .append(\" \")\n                        .append(quoteIdentifier(event.getColumn().getName()))\n                        .append(\" \")\n                        .append(columnType);\n\n        // Only decorate with default value when source dialect is same as sink dialect\n        // Todo Support for cross-database default values for ddl statements\n        if (event.getColumn().getDefaultValue() == null) {\n            sqlBuilder.append(\" \").append(event.getColumn().isNullable() ? \"NULL\" : \"NOT NULL\");\n        } else {\n            if (event.getColumn().isNullable()) {\n                sqlBuilder.append(\" NULL\");\n            } else if (sameCatalog) {\n                sqlBuilder.append(\" \").append(event.getColumn().isNullable() ? \"NULL\" : \"NOT NULL\");\n            } else if (SqlType.TIMESTAMP.equals(event.getColumn().getDataType().getSqlType())) {\n                log.warn(\n                        \"Default value is not supported for column {} in table {}. Skipping add column operation. event: {}\",\n                        event.getColumn().getName(),\n                        tablePath.getFullName(),\n                        event);\n            } else {\n                sqlBuilder.append(\" NOT NULL\");\n            }\n            if (sameCatalog) {\n                sqlBuilder\n                        .append(\" \")\n                        .append(sqlClauseWithDefaultValue(typeDefine, sourceDialectName));\n            }\n        }\n\n        if (event.getColumn().getComment() != null) {\n            sqlBuilder\n                    .append(\" \")\n                    .append(\"COMMENT \")","sourceCodeStart":607,"sourceCodeEnd":643,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/JdbcDialect.java#L607-L643","documentation":"While generating ADD COLUMN DDL for a cross-catalog schema change, if the column is a NOT NULL TIMESTAMP and the dialect cannot append a default value (required by some databases for NOT NULL columns), the DDL fragment is not emitted and this warning is logged — the column may be added without NOT NULL or the operation is partially skipped.","triggerScenarios":"applySchemaChange adding a TIMESTAMP column that is non-nullable, where sameCatalog is false (cross-catalog/dialect translation) and no default value can be generated; the code path logs the warning instead of appending NOT NULL/default.","commonSituations":"Schema evolution from a CDC source into a different database type (e.g. MySQL -> Postgres) with NOT NULL timestamp columns lacking defaults; older DB versions requiring defaults on added NOT NULL columns.","solutions":["Make the column nullable in the upstream schema so NULL can be appended","Add an explicit default value for the timestamp column before/instead of the evolution event","Enable same-catalog evolution (sink and source same database type) to get NOT NULL handled natively","Apply the column manually with the desired DDL, then let the pipeline continue"],"exampleFix":"// before\n-- event: ADD COLUMN updated_at TIMESTAMP NOT NULL (no default)\n// after\nALTER TABLE t ADD COLUMN updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;","handlingStrategy":"fallback","validationCode":"// detect the unsupported combination before evolution\nboolean bad = !column.isNullable()\n    && SqlType.TIMESTAMP.equals(column.getDataType().getSqlType())\n    && column.getDefaultValue() == null\n    && !sameCatalog;\nif (bad) { /* add default or make nullable */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Give NOT NULL timestamp columns explicit defaults","Prefer nullable columns for cross-catalog schema evolution","Apply manual DDL with DEFAULT for NOT NULL added columns","Keep source and sink on the same database family when possible"],"tags":["schema-evolution","jdbc","ddl","timestamp","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"}