etseidl commented on code in PR #7369:
URL: https://github.com/apache/arrow-rs/pull/7369#discussion_r2023566643
##########
parquet/src/arrow/async_reader/mod.rs:
##########
@@ -147,31 +158,16 @@ impl<T: AsyncRead + AsyncSeek + Unpin + Send>
AsyncFileReader for T {
&'a mut self,
options: Option<&'a ArrowReaderOptions>,
) -> BoxFuture<'a, Result<Arc<ParquetMetaData>>> {
- const FOOTER_SIZE_I64: i64 = FOOTER_SIZE as i64;
async move {
- self.seek(SeekFrom::End(-FOOTER_SIZE_I64)).await?;
-
- let mut buf = [0_u8; FOOTER_SIZE];
- self.read_exact(&mut buf).await?;
-
- 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();
+ let metadata_reader = ParquetMetaDataReader::new()
+ .with_page_indexes(options.is_some_and(|o| o.page_index));
#[cfg(feature = "encryption")]
let metadata_reader = metadata_reader.with_decryption_properties(
options.and_then(|o| o.file_decryption_properties.as_ref()),
);
- let parquet_metadata =
metadata_reader.decode_footer_metadata(&buf, &footer)?;
-
+ let parquet_metadata =
metadata_reader.load_via_suffix_and_finish(self).await?;
Review Comment:
Yes, I recall. But the code that's replaced already did seeks from the end
of the file. I assume it's ok here because it's not really an object store,
just async access to a file in most instances.
--
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]