alamb opened a new issue, #10739:
URL: https://github.com/apache/arrow-rs/issues/10739

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   
   The JSON writer has been extensible since #7015: `EncoderFactory` lets users 
override how a type is encoded, or add encodings for types the writer doesn't 
handle. The reader has no equivalent — the decoder dispatch is hardwired, so 
custom decoding (e.g. reading `Binary` from something other than the default 
hex string, or decoding extension types such as Variant, #8987) requires 
forking the reader.
   
   **Describe the solution you'd like**
   
   A reader-side counterpart to `EncoderFactory`:
   
   - A public `DecoderFactory` trait consulted before the reader's default 
dispatch (`Ok(None)` accepts the default)
   - Registered via `ReaderBuilder::with_decoder_factory`
   - Able to delegate to default decoders for child types (e.g. via a public 
`DecoderContext::make_decoder`), so overriding a nested type doesn't require 
reimplementing its children (see @scovich's feedback on #9021)
   
   **Describe alternatives you've considered**
   
   Pre/post-processing batches with `arrow_cast` (works only for 
representations expressible as another Arrow type round-trip) or maintaining a 
forked reader.
   
   **Additional context**
   
   - Prior art: #9021, #9272 (both went stale)
   - Prefactors already merged from #9272: #9266, #9270, #9271 
(`DecoderContext` is on `main`)
   - Current implementation PR: #10670
   - Step toward #8987 (deserialize Variant fields)
   


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