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

   # Which issue does this PR close?
   
   Part of https://github.com/apache/arrow-rs/issues/8987
   
   # Rationale for this change
   
   Supporting custom type decoders in JSON reads requires some ability to 
create nested and/or delegating decoder factories. For example:
   1. Quirks-mode decoding of a complex type that attempts to parse string 
inputs to the requested type
      * Falls back to the default decoder for non-string inputs
   2. Convert complex type mismatches to NULL instead of error
      * Use the default decoder only if the input type matches
   3. Compound decoder factories, e.g.
      * Support multiple extension types, each provided by their own factory
      * Support a mix of "standard" extension type decoders and custom "quicks 
mode" decoders
   
   Such use cases mean decoder factories will need access to the functionality 
currently provided by `make_decoder`, and the latter will need to be aware of 
the top-level decoder factory in use, even if that decoder factory has 
delegated to a more specific decoder factory who would actually call 
`make_decoder`. 
   
   # What changes are included in this PR?
   
   Create a new `DecoderContext` struct that bundles up the top-level args that 
are passed unchanged through the entire schema traversal that `make_decoder` 
performs. It reduces the arg count, and also gives a place to store the decoder 
factory that `make_decoder` should eventually know how to use, without churning 
function signatures a second time. It will also help insulate the signature of 
the private `make_decoder` API from the decoder factory API that will become 
public.
   
   # Are these changes tested?
   
   Existing unit tests validate the refactor.
   
   # Are there any user-facing changes?
   
   No. All methods and data types involved are private to the arrow-json crate.


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