corwinjoy commented on code in PR #6637:
URL: https://github.com/apache/arrow-rs/pull/6637#discussion_r1943900895
##########
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:
@rok I don't think you want to use `.with_page_indexes(true) ` because you
could have a logic case where the first part of the if statement
(`options.page_index && ...`) is false but use_encryption is true. That's why,
in my draft I broke out these logic flags.
--
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]