Skip to main content

Module arrow_impl

Module arrow_impl 

Source
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 From between concrete array types.
converts_with_time_unit πŸ”’
converts_with_type πŸ”’
Used to convert different types.

TraitsΒ§

FromArrow
Defines how to convert Arrow arrays to RisingWave arrays.
FromIntoArrow πŸ”’
Converts RisingWave value from and into Arrow value.
TemporalArrowConvert πŸ”’
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.
TryFromIntoArrow πŸ”’
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 an arrow.parquet.variant struct against Variant. A variant extension binds exclusively to Variant at 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 a Field is 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 πŸ”’