pub struct AvroArrowArrayReader<'a, R: Read> {
reader: Reader<'a, R>,
schema: SchemaRef,
schema_lookup: BTreeMap<String, usize>,
}Fields§
§reader: Reader<'a, R>§schema: SchemaRef§schema_lookup: BTreeMap<String, usize>Implementations§
Source§impl<R: Read> AvroArrowArrayReader<'_, R>
impl<R: Read> AvroArrowArrayReader<'_, R>
pub fn try_new(reader: R, schema: SchemaRef) -> Result<Self>
pub fn schema_lookup(schema: AvroSchema) -> Result<BTreeMap<String, usize>>
fn child_schema_lookup<'b>( parent_field_name: &str, schema: &AvroSchema, schema_lookup: &'b mut BTreeMap<String, usize>, ) -> Result<&'b BTreeMap<String, usize>>
Sourcepub fn next_batch(
&mut self,
batch_size: usize,
) -> Option<ArrowResult<RecordBatch>>
pub fn next_batch( &mut self, batch_size: usize, ) -> Option<ArrowResult<RecordBatch>>
Read the next batch of records
fn build_boolean_array( &self, rows: &'_ [&'_ Vec<(String, Value)>], col_name: &str, ) -> ArrayRef
fn build_primitive_array<T>( &self, rows: &'_ [&'_ Vec<(String, Value)>], col_name: &str, ) -> ArrayRef
fn build_string_dictionary_builder<T>(
&self,
row_len: usize,
) -> StringDictionaryBuilder<T>where
T: ArrowPrimitiveType + ArrowDictionaryKeyType,
fn build_wrapped_list_array( &self, rows: &'_ [&'_ Vec<(String, Value)>], col_name: &str, key_type: &DataType, ) -> ArrowResult<ArrayRef>
fn list_array_string_array_builder<D>(
&self,
data_type: &DataType,
col_name: &str,
rows: &'_ [&'_ Vec<(String, Value)>],
) -> ArrowResult<ArrayRef>where
D: ArrowPrimitiveType + ArrowDictionaryKeyType,
fn build_dictionary_array<T>(
&self,
rows: &'_ [&'_ Vec<(String, Value)>],
col_name: &str,
) -> ArrowResult<ArrayRef>where
T::Native: NumCast,
T: ArrowPrimitiveType + ArrowDictionaryKeyType,
fn build_string_dictionary_array( &self, rows: &'_ [&'_ Vec<(String, Value)>], col_name: &str, key_type: &DataType, value_type: &DataType, ) -> ArrowResult<ArrayRef>
Sourcefn build_nested_list_array<OffsetSize: OffsetSizeTrait>(
&self,
parent_field_name: &str,
rows: &[&Value],
list_field: &Field,
) -> ArrowResult<ArrayRef>
fn build_nested_list_array<OffsetSize: OffsetSizeTrait>( &self, parent_field_name: &str, rows: &[&Value], list_field: &Field, ) -> ArrowResult<ArrayRef>
Build a nested GenericListArray from a list of unnested Values
Sourcefn build_struct_array(
&self,
rows: &'_ [&'_ Vec<(String, Value)>],
parent_field_name: &str,
struct_fields: &Fields,
) -> ArrowResult<Vec<ArrayRef>>
fn build_struct_array( &self, rows: &'_ [&'_ Vec<(String, Value)>], parent_field_name: &str, struct_fields: &Fields, ) -> ArrowResult<Vec<ArrayRef>>
Builds the child values of a StructArray, falling short of constructing the StructArray.
The function does not construct the StructArray as some callers would want the child arrays.
Note: The function is recursive, and will read nested structs.
Sourcefn read_primitive_list_values<T>(&self, rows: &[&Value]) -> ArrayDatawhere
T: ArrowPrimitiveType + ArrowNumericType,
T::Native: NumCast,
fn read_primitive_list_values<T>(&self, rows: &[&Value]) -> ArrayDatawhere
T: ArrowPrimitiveType + ArrowNumericType,
T::Native: NumCast,
Read the primitive list’s values into ArrayData
fn field_lookup<'b>( &self, name: &str, row: &'b [(String, Value)], ) -> Option<&'b Value>
Auto Trait Implementations§
impl<'a, R> Freeze for AvroArrowArrayReader<'a, R>where
R: Freeze,
impl<'a, R> RefUnwindSafe for AvroArrowArrayReader<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Send for AvroArrowArrayReader<'a, R>where
R: Send,
impl<'a, R> Sync for AvroArrowArrayReader<'a, R>where
R: Sync,
impl<'a, R> Unpin for AvroArrowArrayReader<'a, R>where
R: Unpin,
impl<'a, R> UnwindSafe for AvroArrowArrayReader<'a, R>where
R: UnwindSafe,
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more