Skip to main content

IntoArrow

Trait IntoArrow 

Source
pub trait IntoArrow {
    // Required method
    fn into_arrow(self) -> DoraArray;
}
Expand description

Data that can be converted into a dora payload.

This is the conversion that dora node APIs use to turn plain Rust values into the Apache Arrow columnar format before sending them as outputs. Implementations are provided for booleans, strings, the primitive integer and float types, Vecs of those primitive types, and a few chrono date/time types. The unit type () converts to an empty null array, which is useful for outputs that carry only metadata. DoraArray itself implements the trait as the identity conversion, so send_output accepts both plain Rust values and already-built payloads.

The trait deliberately has no associated type: an type A: arrow::array::Array bound would put Arrow back into dora’s frozen public API and pin 1.x to a single Arrow major. into_arrow returns the dora-owned DoraArray instead.

For the opposite direction (reading received Arrow data back into Rust types), see the TryFrom<&DoraArray> implementations on DoraArray.

§Example

use dora_arrow_convert::IntoArrow;

let array = vec![1.0_f32, 2.0, 3.0].into_arrow();
assert_eq!(array.len(), 3);

let single = 42_u8.into_arrow();
assert_eq!(single.len(), 1);

Required Methods§

Source

fn into_arrow(self) -> DoraArray

Convert the data into a dora payload.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoArrow for &str

Source§

impl IntoArrow for ()

Source§

impl IntoArrow for NaiveDate

Source§

impl IntoArrow for NaiveDateTime

The nanosecond-resolution i64 timestamp can only represent dates in roughly 1677-09-21..2262-04-11. Dates outside that range are saturated to i64::MIN (far-past) or i64::MAX (far-future) and a tracing::warn! is emitted, rather than silently mapping to the Unix epoch (the previous behaviour).

Source§

impl IntoArrow for NaiveTime

Source§

impl IntoArrow for String

Source§

impl IntoArrow for Vec<String>

Source§

impl IntoArrow for Vec<f16>

Source§

impl IntoArrow for Vec<f32>

Source§

impl IntoArrow for Vec<f64>

Source§

impl IntoArrow for Vec<i8>

Source§

impl IntoArrow for Vec<i16>

Source§

impl IntoArrow for Vec<i32>

Source§

impl IntoArrow for Vec<i64>

Source§

impl IntoArrow for Vec<u8>

Source§

impl IntoArrow for Vec<u16>

Source§

impl IntoArrow for Vec<u32>

Source§

impl IntoArrow for Vec<u64>

Source§

impl IntoArrow for bool

Source§

impl IntoArrow for f16

Source§

impl IntoArrow for f32

Source§

impl IntoArrow for f64

Source§

impl IntoArrow for i8

Source§

impl IntoArrow for i16

Source§

impl IntoArrow for i32

Source§

impl IntoArrow for i64

Source§

impl IntoArrow for u8

Source§

impl IntoArrow for u16

Source§

impl IntoArrow for u32

Source§

impl IntoArrow for u64

Implementors§