pub struct ReaderBuilder<R> {
reader: R,
file_size: u64,
batch_size: usize,
range: Option<Range<u64>>,
reader_schema: Option<AvroSchema>,
projection: Option<Vec<usize>>,
header_size_hint: Option<u64>,
utf8_view: bool,
strict_mode: bool,
}Expand description
Builder for an asynchronous Avro file reader.
Fields§
§reader: R§file_size: u64§batch_size: usize§range: Option<Range<u64>>§reader_schema: Option<AvroSchema>§projection: Option<Vec<usize>>§header_size_hint: Option<u64>§utf8_view: bool§strict_mode: boolImplementations§
Source§impl<R> ReaderBuilder<R>
impl<R> ReaderBuilder<R>
pub(super) fn new(reader: R, file_size: u64, batch_size: usize) -> Self
Sourcepub fn with_range(self, range: Range<u64>) -> Self
pub fn with_range(self, range: Range<u64>) -> Self
Specify a byte range to read from the Avro file. If this is provided, the reader will read all the blocks within the specified range, if the range ends mid-block, it will attempt to fetch the remaining bytes to complete the block, but no further blocks will be read. If this is omitted, the full file will be read.
Sourcepub fn with_reader_schema(self, reader_schema: AvroSchema) -> Self
pub fn with_reader_schema(self, reader_schema: AvroSchema) -> Self
Specify a reader schema to use when reading the Avro file. This can be useful to project specific columns or handle schema evolution. If this is not provided, the schema will be derived from the Arrow schema provided.
Sourcepub fn with_projection(self, projection: Vec<usize>) -> Self
pub fn with_projection(self, projection: Vec<usize>) -> Self
Specify a projection of column indices to read from the Avro file. This can help optimize reading by only fetching the necessary columns.
Sourcepub fn with_header_size_hint(self, hint: u64) -> Self
pub fn with_header_size_hint(self, hint: u64) -> Self
Provide a hint for the expected size of the Avro header in bytes. This can help optimize the initial read operation when fetching the header.
Sourcepub fn with_utf8_view(self, utf8_view: bool) -> Self
pub fn with_utf8_view(self, utf8_view: bool) -> Self
Enable usage of Utf8View types when reading string data.
Sourcepub fn with_strict_mode(self, strict_mode: bool) -> Self
pub fn with_strict_mode(self, strict_mode: bool) -> Self
Enable strict mode for schema validation and data reading.