rok commented on code in PR #6637:
URL: https://github.com/apache/arrow-rs/pull/6637#discussion_r1945683053


##########
parquet/src/arrow/async_reader/mod.rs:
##########
@@ -172,17 +199,34 @@ impl ArrowReaderMetadata {
     pub async fn load_async<T: AsyncFileReader>(
         input: &mut T,
         options: ArrowReaderOptions,
+        #[cfg(feature = "encryption")] file_decryption_properties: Option<
+            &FileDecryptionProperties,
+        >,
     ) -> Result<Self> {
         // TODO: this is all rather awkward. It would be nice if 
AsyncFileReader::get_metadata
         // took an argument to fetch the page indexes.
-        let mut metadata = input.get_metadata().await?;
+        let mut metadata = input
+            .get_metadata(
+                #[cfg(feature = "encryption")]
+                file_decryption_properties,
+            )
+            .await?;
+
+        #[cfg(feature = "encryption")]
+        let use_encryption = file_decryption_properties.is_some();
+
+        #[cfg(not(feature = "encryption"))]
+        let use_encryption = false;
 
-        if options.page_index
+        if (options.page_index
             && metadata.column_index().is_none()
-            && metadata.offset_index().is_none()
+            && metadata.offset_index().is_none())
+            || use_encryption
         {
             let m = Arc::try_unwrap(metadata).unwrap_or_else(|e| 
e.as_ref().clone());
-            let mut reader = 
ParquetMetaDataReader::new_with_metadata(m).with_page_indexes(true);
+            let mut reader = ParquetMetaDataReader::new_with_metadata(m)
+                .with_page_indexes(true)

Review Comment:
   Ok, mostly fixed. Things now compile, but decryption properties don't get 
through yet. I still need to fix 
[this](https://github.com/apache/arrow-rs/blob/83fd6cae1ca78ca6e78b677a25133b9a4ce15b36/parquet/examples/read_with_rowgroup.rs#L118).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to