Skip to main content

IntoArrow

Trait IntoArrow 

Source
pub trait IntoArrow {
    type A: Array;

    // Required method
    fn into_arrow(self) -> Self::A;
}
Expand description

Data that can be converted to an Arrow array.

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 NullArray, which is useful for outputs that carry only metadata.

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

§Example

use arrow::array::Array;
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 Associated Types§

Source

type A: Array

The Arrow array type that the data converts to.

Required Methods§

Source

fn into_arrow(self) -> Self::A

Convert the data into an Arrow array.

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§