From 3241425b1ea35004b20dae9a8334d2c932dc6c17 Mon Sep 17 00:00:00 2001 From: Rok Mihevc Date: Wed, 5 Feb 2025 10:24:07 +0100 Subject: [PATCH] new_with_options --- parquet/src/arrow/async_reader/mod.rs | 67 +++++++++++++++++++-------- 1 file changed, 47 insertions(+), 20 deletions(-) diff --git a/parquet/src/arrow/async_reader/mod.rs b/parquet/src/arrow/async_reader/mod.rs index a772bbc25327..71f69a8796fa 100644 --- a/parquet/src/arrow/async_reader/mod.rs +++ b/parquet/src/arrow/async_reader/mod.rs @@ -1278,9 +1278,14 @@ mod tests { }; let options = ArrowReaderOptions::new().with_page_index(true); - let builder = ParquetRecordBatchStreamBuilder::new_with_options(async_reader, options) - .await - .unwrap(); + let builder = ParquetRecordBatchStreamBuilder::new_with_options( + async_reader, + options, + #[cfg(feature = "encryption")] + None, + ) + .await + .unwrap(); // The builder should have page and offset indexes loaded now let metadata_with_index = builder.metadata(); @@ -1392,9 +1397,14 @@ mod tests { }; let options = ArrowReaderOptions::new().with_page_index(true); - let builder = ParquetRecordBatchStreamBuilder::new_with_options(async_reader, options) - .await - .unwrap(); + let builder = ParquetRecordBatchStreamBuilder::new_with_options( + async_reader, + options, + #[cfg(feature = "encryption")] + None, + ) + .await + .unwrap(); let selection = RowSelection::from(vec![ RowSelector::skip(21), // Skip first page @@ -1475,9 +1485,14 @@ mod tests { }; let options = ArrowReaderOptions::new().with_page_index(true); - let builder = ParquetRecordBatchStreamBuilder::new_with_options(async_reader, options) - .await - .unwrap(); + let builder = ParquetRecordBatchStreamBuilder::new_with_options( + async_reader, + options, + #[cfg(feature = "encryption")] + None, + ) + .await + .unwrap(); let col_idx: usize = rand.gen_range(0..13); let mask = ProjectionMask::leaves(builder.parquet_schema(), vec![col_idx]); @@ -1546,9 +1561,14 @@ mod tests { }; let options = ArrowReaderOptions::new().with_page_index(true); - let builder = ParquetRecordBatchStreamBuilder::new_with_options(async_reader, options) - .await - .unwrap(); + let builder = ParquetRecordBatchStreamBuilder::new_with_options( + async_reader, + options, + #[cfg(feature = "encryption")] + None, + ) + .await + .unwrap(); let col_idx: usize = rand.gen_range(0..13); let mask = ProjectionMask::leaves(builder.parquet_schema(), vec![col_idx]); @@ -1780,14 +1800,19 @@ mod tests { let mask = ProjectionMask::leaves(&parquet_schema, vec![0, 2]); let options = ArrowReaderOptions::new().with_page_index(true); - let stream = ParquetRecordBatchStreamBuilder::new_with_options(async_reader, options) - .await - .unwrap() - .with_projection(mask.clone()) - .with_batch_size(1024) - .with_row_filter(filter) - .build() - .unwrap(); + let stream = ParquetRecordBatchStreamBuilder::new_with_options( + async_reader, + options, + #[cfg(feature = "encryption")] + None, + ) + .await + .unwrap() + .with_projection(mask.clone()) + .with_batch_size(1024) + .with_row_filter(filter) + .build() + .unwrap(); let batches: Vec = stream.try_collect().await.unwrap(); @@ -2172,6 +2197,8 @@ mod tests { let mut reader = ParquetRecordBatchStreamBuilder::new_with_options( tokio::fs::File::from_std(file.try_clone().unwrap()), ArrowReaderOptions::new().with_page_index(true), + #[cfg(feature = "encryption")] + None, ) .await .unwrap();