Expand description
VariantArray and compute kernels for the Variant Binary Encoding from Apache Parquet.
§Main APIs
VariantArray: Represents an array ofVariantvalues.VariantArrayBuilder: For buildingVariantArray
§Compute Kernels
json_to_variant(): Function to convert Arrays of JSON strings to aVariantArray.variant_to_json(): Function to convert aVariantArrayto arrays of JSON strings.cast_to_variant(): Cast Arrow arrays toVariantArray.variant_get(): ConvertVariantArray(or an inner path) to a strongly-typed Arrow array.shred_variant(): Shred aVariantArrayaccording to the provided shredding schemaunshred_variant(): Unshred aVariantArrayto pure binary variant.
§🚧 Work In Progress
This crate is under active development and is not yet ready for production use. If you are interested in helping, you can find more information on the GitHub Variant issue
§Platform Support
Only little-endian platforms are officially supported and tested in CI. Big-endian platforms are not tested in CI and may not work correctly. Fixes for big-endian platforms are welcome and handled on a best-effort basis, but compatibility is not guaranteed.
Structs§
- GetOptions
- Controls the action of the variant_get kernel.
- Shredded
Schema Builder - Builder for constructing a variant shredding schema.
- Shredding
State - Represents the shredding state of a
VariantArray - Variant
Array - An array of Parquet
Variantvalues - Variant
Array Builder - A builder for
VariantArray - Variant
Array Iter - An iterator over
VariantArray - Variant
Type - Arrow Variant
ExtensionType. - Variant
Value Array Builder - A builder for creating only the value column of a
VariantArray
Traits§
- Into
Shredding Field - Convenience conversion to allow passing either
FieldRef,DataType, or(DataType, bool).
Functions§
- cast_
to_ variant - Convert an array to a
VariantArraywith strict mode enabled (returns errors on conversion failures). - cast_
to_ variant_ with_ options - Casts a typed arrow
Arrayto aVariantArray. This is useful when you need to convert a specific data type - json_
to_ variant - Parse a batch of JSON strings into a batch of Variants represented as STRUCT<metadata: BINARY, value: BINARY> where nulls are preserved. The JSON strings in the input must be valid.
- shred_
variant - Shreds the input binary variant using a target shredding schema derived from the requested data type.
- unshred_
variant - Removes all (nested) typed_value columns from a VariantArray by converting them back to binary variant and merging the resulting values back into the value column.
- variant_
get - Returns an array with the specified path extracted from the variant values.
- variant_
to_ json - Transform a
VariantArrayto a batch of JSON strings where nulls are preserved.