Skip to content

Commit 9b8662e

Browse files
corwinjoyrok
authored andcommitted
Add changes needed to access encryption from datafusion.
1 parent ce045ca commit 9b8662e

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

parquet/src/arrow/async_reader/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,15 @@ impl<T: AsyncRead + AsyncSeek + Unpin + Send> AsyncFileReader for T {
177177
let mut buf = Vec::with_capacity(metadata_len);
178178
self.take(metadata_len as _).read_to_end(&mut buf).await?;
179179

180+
#[cfg(feature = "encryption")]
181+
let fd = None;
182+
// let fd = file_decryption_properties.cloned();
183+
180184
Ok(Arc::new(ParquetMetaDataReader::decode_metadata(
181185
&buf,
182186
footer.encrypted_footer(),
183187
#[cfg(feature = "encryption")]
184-
file_decryption_properties,
188+
fd,
185189
)?))
186190
}
187191
.boxed()

parquet/src/encryption/encryption.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ use std::collections::HashMap;
1919

2020
#[derive(Debug, Clone)]
2121
pub struct FileEncryptionProperties {
22-
encrypt_footer: bool,
23-
footer_key: Vec<u8>,
24-
column_keys: Option<HashMap<Vec<u8>, Vec<u8>>>,
25-
aad_prefix: Option<Vec<u8>>,
22+
pub encrypt_footer: bool,
23+
pub footer_key: Vec<u8>,
24+
pub column_keys: Option<HashMap<Vec<u8>, Vec<u8>>>,
25+
pub aad_prefix: Option<Vec<u8>>,
2626
}
2727

2828
impl FileEncryptionProperties {

parquet/src/file/properties.rs

+6
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,11 @@ impl WriterProperties {
289289
self.statistics_truncate_length
290290
}
291291

292+
// Return the encryption properties
293+
pub fn file_encryption_properties(&self) -> Option<&FileEncryptionProperties> {
294+
self.file_encryption_properties.as_ref()
295+
}
296+
292297
/// Returns `true` if type coercion is enabled.
293298
pub fn coerce_types(&self) -> bool {
294299
self.coerce_types
@@ -372,6 +377,7 @@ impl WriterProperties {
372377
.and_then(|c| c.bloom_filter_properties())
373378
.or_else(|| self.default_column_properties.bloom_filter_properties())
374379
}
380+
375381
}
376382

377383
/// Builder for [`WriterProperties`] parquet writer configuration.

0 commit comments

Comments
 (0)