adamreeve commented on code in PR #16649:
URL: https://github.com/apache/datafusion/pull/16649#discussion_r2196363819


##########
datafusion/datasource-parquet/src/file_format.rs:
##########
@@ -959,14 +953,18 @@ pub async fn fetch_parquet_metadata(
     store: &dyn ObjectStore,
     meta: &ObjectMeta,
     size_hint: Option<usize>,
-    decryption_properties: Option<&FileDecryptionProperties>,
+    #[allow(unused)] decryption_properties: Option<&FileDecryptionProperties>,

Review Comment:
   Would it be better to use `#[cfg(feature = "parquet_encryption")]` on this 
parameter so this isn't a breaking change unless the encryption feature is 
enabled? (assuming this PR goes in before the next release)



##########
datafusion/datasource-parquet/src/file_format.rs:
##########
@@ -959,14 +953,18 @@ pub async fn fetch_parquet_metadata(
     store: &dyn ObjectStore,
     meta: &ObjectMeta,
     size_hint: Option<usize>,
-    decryption_properties: Option<&FileDecryptionProperties>,
+    #[allow(unused)] decryption_properties: Option<&FileDecryptionProperties>,
 ) -> Result<ParquetMetaData> {
     let file_size = meta.size;
     let fetch = ObjectStoreFetch::new(store, meta);
 
-    ParquetMetaDataReader::new()
-        .with_prefetch_hint(size_hint)
-        .with_decryption_properties(decryption_properties)
+    #[allow(unused_mut)]
+    let mut reader = 
ParquetMetaDataReader::new().with_prefetch_hint(size_hint);

Review Comment:
   I don't think this mut is needed even with `parquet_encryption` enabled, as 
`with_decryption_properties` takes ownership of the reader.
   
   ```suggestion
       let reader = ParquetMetaDataReader::new().with_prefetch_hint(size_hint);
   ```



##########
datafusion/common/src/encryption.rs:
##########
@@ -0,0 +1,76 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Support optional features for encryption in Parquet files.
+//! This module provides types and functions related to encryption in Parquet 
files.
+
+#[cfg(feature = "parquet_encryption")]

Review Comment:
   Rather than having so may `cfg` lines in this file, you could have the 
module implemented in two separate files, one for when encryption is enabled 
and one for when it's disabled.
   
   Eg. see 
https://github.com/apache/arrow-rs/blob/ff3a2f2c59f0355f8afedb3e9258e1d6307f21ae/parquet/src/column/mod.rs#L121-L125



-- 
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...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to