adamreeve commented on code in PR #7342:
URL: https://github.com/apache/arrow-rs/pull/7342#discussion_r2020300712


##########
parquet/src/arrow/async_reader/mod.rs:
##########
@@ -172,37 +159,14 @@ impl<T: AsyncRead + AsyncSeek + Unpin + Send> 
AsyncFileReader for T {
 
             let footer = ParquetMetaDataReader::decode_footer_tail(&buf)?;
             let metadata_len = footer.metadata_length();
-            self.seek(SeekFrom::End(-FOOTER_SIZE_I64 - metadata_len as i64))
-                .await?;
-
-            let mut buf = Vec::with_capacity(metadata_len);
-            self.take(metadata_len as _).read_to_end(&mut buf).await?;
-
-            let metadata_reader = ParquetMetaDataReader::new();
-
             #[cfg(feature = "encryption")]
-            let metadata_reader = metadata_reader
-                
.with_decryption_properties(options.file_decryption_properties.as_ref());
+            let have_decryptor = options.is_some() &&

Review Comment:
   I think this method can be simplified a lot to remove most of the `cfg` 
checks and the need for `have_decryptor`. The error handling here duplicates 
checks that are already present in 
`ParquetMetaDataReader::decode_footer_metadata` and 
`ParquetMetaDataReader::decode_metadata_with_encryption` so this shouldn't be 
needed any more.
   
   I couldn't get GitHub to show a suggested change in the PR, but have pushed 
a commit with a suggestion to 
https://github.com/adamreeve/arrow-rs/commit/2158f314a784c37b5e61aaab1dec0437c3ebc0cb
   



##########
parquet/src/arrow/async_reader/mod.rs:
##########
@@ -236,7 +215,7 @@ impl ArrowReaderMetadata {
     ) -> Result<Self> {
         // TODO: this is all rather awkward. It would be nice if 
AsyncFileReader::get_metadata
         // took an argument to fetch the page indexes.

Review Comment:
   Slight aside, but given `get_metadata` now accepts `ArrowReaderOptions`, 
should it be possible to make it respect `options.page_index` and tidy this up? 
(Maybe a question for @etseidl)



-- 
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