SEZ9 commented on issue #11632:
URL: https://github.com/apache/seatunnel/issues/11632#issuecomment-5176887817

   Thanks for the well-researched report, including distinguishing this from 
the Debezium path fixed in PR #7950. Confirmed that `JsonToRowConverters` / 
`JsonDeserializationSchema` in `seatunnel-format-json` only reads the JsonNode 
and has no logic to fall back to `Column.getDefaultValue()` when the node is 
missing or null, so the config is silently ignored.
   
   Suggested fix direction: in the JSON row converter, when the field node is 
absent or NullNode, check the corresponding `Column` for a non-null 
`defaultValue`, convert it to the column's SeaTunnel data type, and use it 
instead of null. This should be gated so explicit nulls on nullable columns 
without a default still yield null. A unit test in `seatunnel-format-json` 
covering both the missing-field and explicit-null cases would be needed.
   
   One design point to settle before implementing: should `defaultValue` apply 
only when the field is missing, or also when the field is explicitly `null` in 
the payload (as this issue expects)? Also note other formats (e.g., text/csv) 
may have the same gap — worth checking whether the fix should live in a shared 
layer rather than per-format. Would you be willing to submit a PR?
   
   <!-- streview-comment:49 -->


-- 
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