xushiyan commented on PR #503:
URL: https://github.com/apache/hudi-rs/pull/503#issuecomment-3704100045

   ## Response to Copilot feedback on clone() usage
   
   The `clone()` calls are intentional and necessary. Here's why:
   
   **API Change:** apache-avro 0.17.0 used `GetU8(ValueKind)` (lightweight 
discriminant), but 0.21.0 changed to `GetU8(Value)` (full value). The old 
`.into()` was a cheap discriminant extraction; the new API requires owned 
`Value` for richer error messages.
   
   **Why not `Value::Null`:** Using a placeholder would degrade error quality:
   - With clone: `Unable to convert to u8, got String("hello")`
   - With Null: `Unable to convert to u8, got Null` ← misleading
   
   **Performance:** These clones only execute on error paths (exceptional, not 
hot path), so the cost is acceptable and preserves diagnostic value.


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