adamreeve commented on code in PR #7439:
URL: https://github.com/apache/arrow-rs/pull/7439#discussion_r2076315063
##########
parquet/src/file/metadata/writer.rs:
##########
@@ -622,25 +635,30 @@ impl MetadataObjectWriter {
}
}
- fn file_crypto_metadata(
- file_encryptor: &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: if properties.store_aad_prefix() {
- properties.aad_prefix().cloned()
- } else {
- None
- },
- aad_file_unique: Some(file_encryptor.aad_file_unique().clone()),
- supply_aad_prefix,
- };
+ fn get_footer_encryption_algorithm(&self) -> Option<EncryptionAlgorithm> {
+ if let Some(file_encryptor) = &self.file_encryptor {
+ let supply_aad_prefix = file_encryptor
+ .properties()
+ .aad_prefix()
+ .map(|_| !file_encryptor.properties().store_aad_prefix());
+ let encryption_algorithm = EncryptionAlgorithm::AESGCMV1(AesGcmV1 {
+ aad_prefix: if file_encryptor.properties().store_aad_prefix() {
+ file_encryptor.properties().aad_prefix().cloned()
+ } else {
+ None
+ },
+ aad_file_unique:
Some(file_encryptor.aad_file_unique().clone()),
+ supply_aad_prefix,
+ });
+ return Some(encryption_algorithm);
+ }
+ None
+ }
+ fn file_crypto_metadata(&self) ->
Result<crate::format::FileCryptoMetaData> {
+ let properties = self.file_encryptor.as_ref().unwrap().properties();
Review Comment:
See 7fd3c1329fb571d4832232f4012190fc78afe0ca, I've pushed that to this
branch but feel free to change it.
--
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]