alamb commented on code in PR #6637: URL: https://github.com/apache/arrow-rs/pull/6637#discussion_r1983969072
########## parquet/src/arrow/async_reader/mod.rs: ########## @@ -2336,4 +2451,241 @@ mod tests { let result = reader.try_collect::<Vec<_>>().await.unwrap(); assert_eq!(result.len(), 1); } + + #[cfg(feature = "encryption")] + async fn verify_encryption_test_file_read( + file: &mut File, + decryption_properties: FileDecryptionProperties, + ) { + let options = + ArrowReaderOptions::new().with_file_decryption_properties(decryption_properties); + + let metadata = ArrowReaderMetadata::load_async(file, options.clone()) + .await + .unwrap(); + let arrow_reader_metadata = ArrowReaderMetadata::load_async(file, options) + .await + .unwrap(); + let file_metadata = metadata.metadata.file_metadata(); + + let record_reader = ParquetRecordBatchStreamBuilder::new_with_metadata( + file.try_clone().await.unwrap(), + arrow_reader_metadata.clone(), + ) + .build() + .unwrap(); + let record_batches = record_reader.try_collect::<Vec<_>>().await.unwrap(); + + assert_eq!(file_metadata.num_rows(), 50); + assert_eq!(file_metadata.schema_descr().num_columns(), 8); + assert_eq!( + file_metadata.created_by().unwrap(), + "parquet-cpp-arrow version 19.0.0-SNAPSHOT" + ); + + metadata.metadata.row_groups().iter().for_each(|rg| { + assert_eq!(rg.num_columns(), 8); + assert_eq!(rg.num_rows(), 50); + }); + + let mut row_count = 0; Review Comment: this looks mostly duplicated from parquet/src/arrow/arrow_reader/mod.rs I wonder if there is some way to avoid the duplication -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org