ArrowReaderBuilder

Struct ArrowReaderBuilder 

Source
pub struct ArrowReaderBuilder<R> { /* private fields */ }

Implementations§

Source§

impl<R> ArrowReaderBuilder<R>

Source

pub fn file_metadata(&self) -> &FileMetadata

Source

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

Source

pub fn with_projection(self, projection: ProjectionMask) -> Self

Source

pub fn with_schema(self, schema: SchemaRef) -> Self

Source

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

Source

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();
Source

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();
Source

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
Source

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.

Source§

impl<R: ChunkReader> ArrowReaderBuilder<R>

Source

pub fn try_new(reader: R) -> Result<Self>

Source

pub fn build(self) -> ArrowReader<R>

Source§

impl<R: AsyncChunkReader + 'static> ArrowReaderBuilder<R>

Source

pub async fn try_new_async(reader: R) -> Result<Self>

Source

pub fn build_async(self) -> ArrowStreamReader<R>

Auto Trait Implementations§

§

impl<R> Freeze for ArrowReaderBuilder<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for ArrowReaderBuilder<R>
where R: RefUnwindSafe,

§

impl<R> Send for ArrowReaderBuilder<R>
where R: Send,

§

impl<R> Sync for ArrowReaderBuilder<R>
where R: Sync,

§

impl<R> Unpin for ArrowReaderBuilder<R>
where R: Unpin,

§

impl<R> UnwindSafe for ArrowReaderBuilder<R>
where R: UnwindSafe,

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSend for T
where T: Send,