harshmotw-db opened a new pull request, #7783: URL: https://github.com/apache/arrow-rs/pull/7783
# Which issue does this PR close? - Closes #7425. # Rationale for this change Explained in the issue # What changes are included in this PR? This PR includes a `json_to_variant` API to parse JSON strings as Variants. `json_to_variant` takes as argument the input JSON string and an object implementing `VariantBufferManager` (explained later), and returns the size of the resulting `metadata` and `value` fields. `VariantBufferManager` is a new trait that allows the caller to have control over the output buffers where the Variant data would be written. This PR proposes that this trait be expanded deep into the library to give the caller lower-level control. A sample vector-based buffer manager could be provided to callers that are not interested in implementing their own buffer manager. `VariantBufferManager` requires the implementation of four API's: 1. `borrow_metadata_buffer` which returns a slice where metadata writes should be performed. The slice must preserve data that may have been written so far. 2. `borrow_value_buffer` which returns a slice where value writes should be performed. The slice must preserve data that may have been written so far. 3. `ensure_metadata_buffer_size(size)` which must ensure that subsequent calls to `borrow_metadata_buffer` return a slice of at least `size` bytes. 4. `ensure_value_buffer_size(size)` which must ensure that subsequent calls to `borrow_value_buffer` return a slice of at least `size` bytes. # Are these changes tested? Unit Tests, and an example file. # Are there any user-facing changes? Yes, the PR introduces the `json_to_variant` API and the `VariantBufferManager` trait. -- 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