adamreeve commented on code in PR #7111:
URL: https://github.com/apache/arrow-rs/pull/7111#discussion_r2004576722
##########
parquet/src/file/metadata/writer.rs:
##########
@@ -182,6 +258,95 @@ impl<'a, W: Write> ThriftMetadataWriter<'a, W> {
self.key_value_metadata = Some(key_value_metadata);
self
}
+
+ #[cfg(feature = "encryption")]
+ pub fn with_file_encryptor(mut self, file_encryptor:
Option<Arc<FileEncryptor>>) -> Self {
+ self.file_encryptor = file_encryptor;
+ self
+ }
+
+ #[cfg(feature = "encryption")]
+ fn file_crypto_metadata(
+ file_encryptor: &Arc<FileEncryptor>,
+ ) -> Result<crate::format::FileCryptoMetaData> {
+ let properties = file_encryptor.properties();
+ let supply_aad_prefix = properties
+ .aad_prefix()
+ .map(|_| !properties.store_aad_prefix());
+ let encryption_algorithm = AesGcmV1 {
+ aad_prefix: properties.aad_prefix().cloned(),
Review Comment:
:+1: that looks right to me, although you can avoid the `clone` by matching
on a reference:
```rust
let supply_aad_prefix = match &t_file_crypto_metadata.encryption_algorithm {
```
--
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]