linliu-code commented on PR #19900:
URL: https://github.com/apache/hudi/pull/19900#issuecomment-5638278806

   Closing in favour of fixing the generation sites instead.
   
   This PR made `HoodieAvroRecord` derive its own ordering value when the 
payload has none. That is a fallback: it fires on 
`OrderingValues.isDefault(...)`, which cannot distinguish "the payload has no 
ordering value" from "its ordering value is genuinely 0", and making that 
inference safe required four guards (the default check, a delete gate, a null 
gate, and a catch-all around the decode). Needing four guards to make a guess 
safe is the signal that the guess is the wrong move.
   
   The record should instead be born with its ordering value. There are exactly 
two generation sites that build one without:
   
   - `HoodieCreateRecordUtils` (Spark SQL / DataSource) — fixed separately
   - `HoodieStreamerUtils` (Hudi Streamer) — fixed separately
   
   Fixing those addresses the cause rather than surviving it. Tracked with the 
design issue apache/hudi#19901, which proposes going one level further and 
making "no ordering value" unrepresentable rather than encoded as an untyped 0.


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