Skip to content

Commit

Permalink
new_with_options
Browse files Browse the repository at this point in the history
  • Loading branch information
rok committed Feb 5, 2025
1 parent 925d86f commit 3241425
Showing 1 changed file with 47 additions and 20 deletions.
67 changes: 47 additions & 20 deletions parquet/src/arrow/async_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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<RecordBatch> = stream.try_collect().await.unwrap();

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 3241425

Please sign in to comment.