rok commented on code in PR #8305:
URL: https://github.com/apache/arrow-rs/pull/8305#discussion_r2666228086
##########
parquet/src/file/metadata/writer.rs:
##########
@@ -755,34 +755,39 @@ impl MetadataObjectWriter {
) -> Result<ColumnChunkMetaData> {
// Column crypto metadata should have already been set when the column
was created.
// Here we apply the encryption by encrypting the column metadata if
required.
- match column_chunk.column_crypto_metadata.as_deref() {
- None => {}
+ let encryptor = match column_chunk.column_crypto_metadata.as_deref() {
+ None => None,
Some(ColumnCryptoMetaData::ENCRYPTION_WITH_FOOTER_KEY) => {
- // When uniform encryption is used the footer is already
encrypted,
- // so the column chunk does not need additional encryption.
+ // We always encrypt column metadata separately and store in
+ // encrypted_column_metadata. This allows skipping the
plaintext meta_data
+ // field in the writer to reduce footer size. If
encrypted_column_metadata
+ // were not set, the reader would not be able to read the
column metadata.
+ Some(file_encryptor.get_footer_encryptor()?)
Review Comment:
Sorry, forgot to reply here. I've introduced `bool
ColumnChunkMeteData.plaintext_footer_mode` that now helps writer decide if it
should write metadata or not. [See
change.](https://github.com/apache/arrow-rs/pull/8305/changes/31df47d3a6f0816a3f48b2e81173965af17d18bb..bb283d4c7f7b8bb858a853cc9f57ca8209ead763)
--
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]