Type Alias parquet::arrow::arrow_reader::ParquetRecordBatchReaderBuilder
source · pub type ParquetRecordBatchReaderBuilder<T> = ArrowReaderBuilder<SyncReader<T>>;
Expand description
A synchronous builder used to construct ParquetRecordBatchReader
for a file
For an async API see [crate::arrow::async_reader::ParquetRecordBatchStreamBuilder
]
See ArrowReaderBuilder
for additional member functions
Aliased Type§
struct ParquetRecordBatchReaderBuilder<T> { /* private fields */ }
Implementations§
source§impl<T: ChunkReader + 'static> ParquetRecordBatchReaderBuilder<T>
impl<T: ChunkReader + 'static> ParquetRecordBatchReaderBuilder<T>
sourcepub fn try_new(reader: T) -> Result<Self>
pub fn try_new(reader: T) -> Result<Self>
Create a new ParquetRecordBatchReaderBuilder
let mut builder = ParquetRecordBatchReaderBuilder::try_new(file).unwrap();
// Inspect metadata
assert_eq!(builder.metadata().num_row_groups(), 1);
// Construct reader
let mut reader: ParquetRecordBatchReader = builder.with_row_groups(vec![0]).build().unwrap();
// Read data
let _batch = reader.next().unwrap().unwrap();
sourcepub fn try_new_with_options(
reader: T,
options: ArrowReaderOptions,
) -> Result<Self>
pub fn try_new_with_options( reader: T, options: ArrowReaderOptions, ) -> Result<Self>
Create a new ParquetRecordBatchReaderBuilder
with ArrowReaderOptions
sourcepub fn new_with_metadata(input: T, metadata: ArrowReaderMetadata) -> Self
pub fn new_with_metadata(input: T, metadata: ArrowReaderMetadata) -> Self
Create a ParquetRecordBatchReaderBuilder
from the provided ArrowReaderMetadata
This allows loading metadata once and using it to create multiple builders with potentially different settings
let metadata = ArrowReaderMetadata::load(&file, Default::default()).unwrap();
let mut a = ParquetRecordBatchReaderBuilder::new_with_metadata(file.clone(), metadata.clone()).build().unwrap();
let mut b = ParquetRecordBatchReaderBuilder::new_with_metadata(file, metadata).build().unwrap();
// Should be able to read from both in parallel
assert_eq!(a.next().unwrap().unwrap(), b.next().unwrap().unwrap());
sourcepub fn build(self) -> Result<ParquetRecordBatchReader>
pub fn build(self) -> Result<ParquetRecordBatchReader>
Build a ParquetRecordBatchReader
Note: this will eagerly evaluate any RowFilter
before returning