pub struct ArrowReaderBuilder<R> { /* private fields */ }Implementations§
Source§impl<R> ArrowReaderBuilder<R>
impl<R> ArrowReaderBuilder<R>
pub fn file_metadata(&self) -> &FileMetadata
pub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_projection(self, projection: ProjectionMask) -> Self
pub fn with_schema(self, schema: SchemaRef) -> Self
Sourcepub fn with_file_byte_range(self, range: Range<usize>) -> Self
pub fn with_file_byte_range(self, range: Range<usize>) -> Self
Specifies a range of file bytes that will read the strips offset within this range
Sourcepub fn with_row_selection(self, row_selection: RowSelection) -> Self
pub fn with_row_selection(self, row_selection: RowSelection) -> Self
Set a RowSelection to filter rows
The RowSelection specifies which rows should be decoded from the ORC file.
This can be used to skip rows that don’t match predicates, reducing I/O and
improving query performance.
§Example
let file = File::open("data.orc").unwrap();
let selection = vec![
RowSelector::skip(100),
RowSelector::select(50),
].into();
let reader = ArrowReaderBuilder::try_new(file)
.unwrap()
.with_row_selection(selection)
.build();Sourcepub fn with_timestamp_precision(self, precision: TimestampPrecision) -> Self
pub fn with_timestamp_precision(self, precision: TimestampPrecision) -> Self
Sets the timestamp precision for reading timestamp columns.
By default, timestamps are read as Nanosecond precision. Use this method to switch to Microsecond precision if needed for compatibility.
§Examples
let file = File::open("/path/to/file.orc").unwrap();
let reader = ArrowReaderBuilder::try_new(file)
.unwrap()
.with_timestamp_precision(TimestampPrecision::Microsecond)
.build();Sourcepub fn with_predicate(self, predicate: Predicate) -> Self
pub fn with_predicate(self, predicate: Predicate) -> Self
Set a predicate for row group filtering
The predicate will be evaluated against row group statistics to automatically
generate a RowSelection that skips filtered row groups. This provides
efficient predicate pushdown based on ORC row indexes.
The predicate is evaluated lazily when each stripe is read, using the row group statistics from the stripe’s index section.
If both with_predicate() and with_row_selection() are called, the results
are combined using logical AND (both conditions must be satisfied).
§Example
let file = File::open("data.orc").unwrap();
// Filter: age >= 18
let predicate = Predicate::gte("age", PredicateValue::Int32(Some(18)));
let reader = ArrowReaderBuilder::try_new(file)
.unwrap()
.with_predicate(predicate)
.build();§Notes
- Predicate evaluation requires row indexes to be present in the ORC file
- If row indexes are missing, the predicate is ignored (all row groups are kept)
- Only primitive columns have row indexes; predicates on compound types may be limited
Sourcepub fn schema(&self) -> SchemaRef
pub fn schema(&self) -> SchemaRef
Returns the currently computed schema
Unless with_schema was called, this is computed dynamically
based on the current projection and the underlying file format.