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
impl ReaderBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new ReaderBuilder
with default settings:
batch_size
= 1024strict_mode
= falseutf8_view
= falseschema
= None
fn make_record_decoder( &self, schema: &AvroSchema<'_>, ) -> Result<RecordDecoder, ArrowError>
fn build_impl<R: BufRead>( self, reader: &mut R, ) -> Result<(Header, Decoder), ArrowError>
Sourcepub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
Sets the row-based batch size
Sourcepub fn with_utf8_view(self, utf8_view: bool) -> Self
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.
Sourcepub fn use_utf8view(&self) -> bool
pub fn use_utf8view(&self) -> bool
Get whether StringViewArray is enabled for string data
Sourcepub fn with_strict_mode(self, strict_mode: bool) -> Self
pub fn with_strict_mode(self, strict_mode: bool) -> Self
Controls whether certain Avro unions of the form [T, "null"]
should produce an error.
Sourcepub fn with_schema(self, schema: AvroSchema<'static>) -> Self
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.
Trait Implementations§
Source§impl Debug for ReaderBuilder
impl Debug for ReaderBuilder
Auto Trait Implementations§
impl Freeze for ReaderBuilder
impl RefUnwindSafe for ReaderBuilder
impl Send for ReaderBuilder
impl Sync for ReaderBuilder
impl Unpin for ReaderBuilder
impl UnwindSafe for ReaderBuilder
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