li3zhi4 commented on PR #11633:
URL: https://github.com/apache/seatunnel/pull/11633#issuecomment-5191415087
Thanks @DanielLeens for the thorough re-review and for the honest carryover
call — no apology needed, this is exactly the kind of serialization-boundary
bug that is easy to miss and CI was right to catch it. The new head
`247d2fea49` addresses all three findings:
**Issue 1 (High — DATE/TIMESTAMP default breaks job submission):**
`fieldFormatterMap` is now `transient` (`JsonToRowConverters.java:85-91`), and
`convertToLocalDate`/`convertToLocalDateTime` lazily re-initialize it when
`null` after deserialization on a worker (`:287-292`, `:320-325`). The
steady-state per-record formatter caching is preserved; only the
non-serializable state stops crossing the serialization boundary. Verified
end-to-end: the Kafka e2e (`KafkaJsonDefaultValueIT`, which configures
`birthday` date + `created_at` timestamp defaults) passes locally 1/1 on this
head, so the `NotSerializableException` that failed CI is gone.
**Issue 2 (Medium — no serialization-boundary coverage):** added
`testSerializableAfterDateDefaultValuePreComputation`, which constructs
`JsonDeserializationSchema` with DATE/TIMESTAMP defaults (triggering the
construction-time pre-computation), round-trips it through `ObjectOutputStream`
→ `ObjectInputStream`, and asserts both that it serializes without
`NotSerializableException` and that defaults still apply after deserialization.
**Issue 3 (Low — present-but-empty-string):** added
`testPresentEmptyStringNotOverwrittenByDefault`, pinning that `{"status": ""}`
keeps the empty string (Jackson `TextNode("")` is neither null nor missing)
while a missing field still gets the default.
Verification: `JsonDefaultValueTest` 14/14, full `seatunnel-format-json`
module 60/60 green, `spotless:apply` clean, `KafkaJsonDefaultValueIT` e2e 1/1
passed locally. Branch is up to date with `dev`.
--
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]