Trait datafusion::common::arrow::array::RecordBatchReader

source ·
pub trait RecordBatchReader: Iterator<Item = Result<RecordBatch, ArrowError>> {
    // Required method
    fn schema(&self) -> Arc<Schema>;

    // Provided method
    fn next_batch(&mut self) -> Result<Option<RecordBatch>, ArrowError> { ... }
}
Expand description

Trait for types that can read RecordBatch’s.

To create from an iterator, see RecordBatchIterator.

Required Methods§

source

fn schema(&self) -> Arc<Schema>

Returns the schema of this RecordBatchReader.

Implementation of this trait should guarantee that all RecordBatch’s returned by this reader should have the same schema as returned from this method.

Provided Methods§

source

fn next_batch(&mut self) -> Result<Option<RecordBatch>, ArrowError>

👎Deprecated since 2.0.0: This method is deprecated in favour of next from the trait Iterator.

Reads the next RecordBatch.

Implementations on Foreign Types§

source§

impl RecordBatchReader for ParquetRecordBatchReader

source§

fn schema(&self) -> Arc<Schema>

Returns the projected SchemaRef for reading the parquet file.

Note that the schema metadata will be stripped here. See ParquetRecordBatchReaderBuilder::schema if the metadata is desired.

source§

impl<R> RecordBatchReader for Box<R>

source§

fn schema(&self) -> Arc<Schema>

Implementors§