Expand description
Converts between arrays and Apache Arrow arrays.
This file acts as a template file for conversion code between arrays and different version of Apache Arrow.
The conversion logic will be implemented for the arrow version specified in the outer mod by
super::arrow_xxx, such as super::arrow_array.
When we want to implement the conversion logic for an arrow version, we first
create a new mod file, and rename the corresponding arrow package name to arrow_xxx
using the use clause, and then declare a sub-mod and set its file path with attribute
#[path = "./arrow_impl.rs"] so that the code in this template file can be embedded to
the new mod file, and the conversion logic can be implemented for the corresponding arrow
version.
Example can be seen in arrow_default.rs, which is also as followed:
use {arrow_array, arrow_buffer, arrow_cast, arrow_schema};
#[allow(clippy::duplicate_mod)]
#[path = "./arrow_impl.rs"]
mod arrow_impl;MacrosΒ§
- converts π
- Implement bi-directional
Frombetween concrete array types. - converts_
with_ πtime_ unit - converts_
with_ πtype - Used to convert different types.
TraitsΒ§
- From
Arrow - Defines how to convert Arrow arrays to RisingWave arrays.
- From
Into πArrow - Converts RisingWave value from and into Arrow value.
- Temporal
Arrow πConvert - Converts a RisingWave temporal scalar to and from Arrowβs physical primitive value using an Arrow time unit.
- ToArrow
- Defines how to convert RisingWave arrays to Arrow arrays.
- TryFrom
Into πArrow - Like
FromIntoArrow, for values whose Arrow representation does not cover the whole RisingWave domain, or vice versa.
FunctionsΒ§
- arrow_
temporal_ πvalue_ overflow - into_
arrow_ πtemporal_ value - invalid_
arrow_ πtemporal_ value - is_
parquet_ field_ match_ source_ schema - Field-aware version of
is_parquet_schema_match_source_schema: it inspects the field metadata to match anarrow.parquet.variantstruct againstVariant. A variant extension binds exclusively toVariantat every nesting depth β declaring such a column as anything else (e.g. the raw physical struct) is an illegal type mismatch, so the parser NULL-fills it instead of decoding a diverging type. Other extensions do not affect matching: decode follows the declared side, which simply ignores them. Prefer this whenever aFieldis available. - is_
parquet_ schema_ match_ source_ schema - This function checks whether the schema of a Parquet file matches the user-defined schema in RisingWave. It handles the following special cases:
- try_
from_ πarrow_ temporal_ value