-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
enhancementAny new improvement worthy of a entry in the changelogAny new improvement worthy of a entry in the changelog
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
- Part of [EPIC] [Parquet] Implement Variant type support in Parquet #6736
- Depends on [Variant] Rust API to Read Variant Values #7423
A major use case for Variant values in Parquet and Arrow is efficiently
processing JSON encoded data. Thus, an important capability is being able to
very efficiently write Variant binary values (described in XXX and in
VariantEncoding.md) to JSON.
This ticket covers an API to convert a single Variant to JSON. Other tickets
will cover converting multiple Variant values to JSON as well as converting
to/from Arrow Utf8* arrays and Variant arrays as well as writing this to/from
parquet.
Describe the solution you'd like
I would like an API to write a variant to json
Describe alternatives you've considered
I suggest an API like this:
// Use API from XXX to read variant values
let metadata: &[u8] = ...;
let value: &[u8] = ...;
let variant = Variant::try_new(metadata, value);
// Location for writing json bytes
// Should be anything that implements std::io::Write or some other trait
let mut json_buffer = vec![];
// Convert the variant value to JSON
variant_to_json(&mut json_buffer, variant)?;
// json_buffer now contains json encoded valuesAdditional context
Metadata
Metadata
Assignees
Labels
enhancementAny new improvement worthy of a entry in the changelogAny new improvement worthy of a entry in the changelog