jecsand838 opened a new pull request, #8223:
URL: https://github.com/apache/arrow-rs/pull/8223

   # Which issue does this PR close?
   
   - Part of https://github.com/apache/arrow-rs/issues/4886
   - Follows up on https://github.com/apache/arrow-rs/pull/8047
   
   # Rationale for this change
   
   Avro `enum` values are **encoded by index** but are **semantically 
identified by symbol name**. During schema evolution it is legal for the writer 
and reader to use different enum symbol *orders* so long as the **symbol set is 
compatible**. The Avro specification requires that, when resolving a writer 
enum against a reader enum, the value be mapped **by symbol name**, not by the 
writer’s numeric index. If the writer’s symbol is not present in the reader’s 
enum and the reader defines a default, the default is used; otherwise it is an 
error.
   
   # What changes are included in this PR?
   
   **Core changes**
   - Implement **writer to reader enum symbol remapping**:
     - Build a fast lookup table at schema resolution time from **writer enum 
index to reader enum index** using symbol **names**.
     - Apply this mapping during decode so the produced Arrow dictionary keys 
always reference the **reader’s** symbol order. 
     - If a writer symbol is not found in the reader enum, surface a clear 
error.
   
   # Are these changes tested?
   
   Yes. This PR adds comprehensive **unit tests** for enum mapping in 
`reader/record.rs` and a **real‑file integration test** in `reader/mod.rs` 
using `avro/simple_enum.avro`.
   
   # Are there any user-facing changes?
   
   N/A due to `arrow-avro` not being public yet.
   


-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to