Struct ReaderBuilder

Source
pub struct ReaderBuilder {
    batch_size: usize,
    strict_mode: bool,
    utf8_view: bool,
    schema: Option<Schema<'static>>,
}
Expand description

A builder to create an Avro Reader that reads Avro data into Arrow RecordBatch.

Fields§

§batch_size: usize§strict_mode: bool§utf8_view: bool§schema: Option<Schema<'static>>

Implementations§

Source§

impl ReaderBuilder

Source

pub fn new() -> Self

Creates a new ReaderBuilder with default settings:

  • batch_size = 1024
  • strict_mode = false
  • utf8_view = false
  • schema = None
Source

fn make_record_decoder( &self, schema: &AvroSchema<'_>, ) -> Result<RecordDecoder, ArrowError>

Source

fn build_impl<R: BufRead>( self, reader: &mut R, ) -> Result<(Header, Decoder), ArrowError>

Source

pub fn with_batch_size(self, batch_size: usize) -> Self

Sets the row-based batch size

Source

pub fn with_utf8_view(self, utf8_view: bool) -> Self

Set whether to use StringViewArray for string data

When enabled, string data from Avro files will be loaded into Arrow’s StringViewArray instead of the standard StringArray.

Source

pub fn use_utf8view(&self) -> bool

Get whether StringViewArray is enabled for string data

Source

pub fn with_strict_mode(self, strict_mode: bool) -> Self

Controls whether certain Avro unions of the form [T, "null"] should produce an error.

Source

pub fn with_schema(self, schema: AvroSchema<'static>) -> Self

Sets the Avro schema.

If a schema is not provided, the schema will be read from the Avro file header.

Source

pub fn build<R: BufRead>(self, reader: R) -> Result<Reader<R>, ArrowError>

Create a Reader from this builder and a BufRead

Source

pub fn build_decoder<R: BufRead>(self, reader: R) -> Result<Decoder, ArrowError>

Create a Decoder from this builder and a BufRead by reading and parsing the Avro file’s header. This will not create a full Reader.

Trait Implementations§

Source§

impl Debug for ReaderBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ReaderBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,