DanielLeens commented on issue #13217:
URL: https://github.com/apache/seatunnel/issues/13217#issuecomment-6894080928

   Thanks for separating the problem into source reading, the SeaTunnel model, 
and target DDL rendering. This is a real inconsistency, but it is a 
cross-module data-contract design, not yet an unclaimed implementation PR.
   
   I rechecked current `dev` at `b3828eb141d3ca669181084dbd73bfb534064e08`:
   
   - `Column` still carries `defaultValue` as an untyped `Object`.
   - `MySqlCatalog.buildColumn` reads only `COLUMN_DEFAULT`.
   - `MysqlCreateTableSqlBuilder.buildColumnIdentifySql` renders the name, 
type, nullability and comment, but no column `DEFAULT`.
   - `JdbcDialect.applySchemaChange` deliberately emits a default only when 
source and target dialect names match; its TODO explicitly leaves 
cross-database default DDL unsupported, and the special-value hook only 
recognizes MySQL defaults.
   
   I also checked open and closed PRs for this issue number and 
`DefaultValueConverter`; none is an exact implementation lane. The open 
JSON-format default-value PRs #11633 and #11634 address missing/null record 
values and must remain separate from catalog and DDL semantics.
   
   Before any code PR, please drive this as an STIP/design discussion and link 
it here. The design needs explicit maintainer agreement on the following 
boundaries:
   
   1. **Compatibility.** Define how an additive representation coexists with 
the existing public `Column.defaultValue` constructors and with old 
serialized/catalog metadata that contains only that field. No reader, copy 
path, schema-change event, or connector may reinterpret an existing value 
merely because the new model exists.
   2. **Supported semantic vocabulary.** A closed, canonical expression catalog 
is preferable to free text, but it must state the v1 values exactly. Typed 
literals, `NULL`, current-time expressions, sequences, generated expressions, 
and arbitrary source functions have different portability and safety 
properties. An unrecognized expression must never be quoted as a literal or 
emitted as target SQL by guesswork.
   3. **Unsupported-target policy.** Please decide per path whether an 
unmappable default blocks the schema operation, is explicitly skipped under a 
user-selected policy, or has another observable outcome. A silent `WARN` plus a 
changed target schema is not sufficient because it changes data semantics.
   4. **Scope and proof.** Pick one initial source/target pair and one path 
first (auto-create or CDC schema evolution), then specify an executable matrix 
for literal strings/escapes, numeric and decimal values, `NULL`, temporal 
expressions, add/modify events where applicable, target-side DDL inspection, 
and schema-event replay/restore. Cross-database expression mapping can be a 
later, separately approved phase.
   
   @sainimal1ba-hue, thank you for offering to help. Please do not open an 
implementation PR yet. A focused STIP/design that resolves the four boundaries 
above is the useful next contribution; after consensus we can define a small 
first implementation slice without mixing incompatible source and target 
semantics.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to