pub struct ArrowReader {
len: usize,
readers: Vec<ColReader>,
}
Expand description
Type that can read out of an arrow::array::StructArray
and into a Row
, given a
RelationDesc
.
The inverse of a crate::builder::ArrowBuilder
.
Note: When creating an ArrowReader
we perform a “one-time downcast” of the children Arrays
from the StructArray
, into enum ColReader
s. This is a much more verbose approach than the
alternative of downcasting from a dyn arrow::array::Array
every time we read a Row
, but
it is much more performant.
Fields§
§len: usize
§readers: Vec<ColReader>
Implementations§
Source§impl ArrowReader
impl ArrowReader
Sourcepub fn new(desc: &RelationDesc, array: StructArray) -> Result<Self, Error>
pub fn new(desc: &RelationDesc, array: StructArray) -> Result<Self, Error>
Create an ArrowReader
validating that the provided RelationDesc
and StructArray
have a matching schema.
The RelationDesc
and StructArray
need to uphold the following to be a valid pair:
- Same number of columns.
- Columns of all the same name.
- Columns of compatible types.
TODO(cf2): Relax some of these restrictions by allowing users to map column names, omit
columns, perform some lightweight casting, and matching not on column name but column
position.
TODO(cf2): Allow specifying an optional arrow::Schema
for extra metadata.
Auto Trait Implementations§
impl Freeze for ArrowReader
impl RefUnwindSafe for ArrowReader
impl Send for ArrowReader
impl Sync for ArrowReader
impl Unpin for ArrowReader
impl UnwindSafe for ArrowReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
Source§impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
Source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.Source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.Source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
Source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.