Repository navigation
Conversation
Specify that the entire page body (repetition levels, definition levels and values) is encrypted as a single page module, including for data pages V2, where the levels are not compressed. Clarify the meaning of compressed_page_size, the V2 level byte lengths and the CRC for encrypted pages, and document the legacy layout written by parquet-java (plaintext levels) so readers can stay backward compatible. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
The parquet-java implementation is in apache/parquet-java#3947 (tracking issue apache/parquet-java#3946).
|
Author
|
Closing in favour of #637, which was opened first and covers the same clarification. If it would help, I can propose the extra details from this PR on #637 instead: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
The Parquet Modular Encryption spec does not say whether the repetition and definition levels of a DataPageV2 are encrypted. Implementations disagree, and cannot read each other's encrypted V2 pages that have non-empty levels:
ColumnChunkPageWriteStore.writePageV2, since 1.12.0) writes the levels in plaintext and encrypts only the (compressed) values.BuildDataPageV2) and arrow-rs (PageEncryptor::encrypt_compressed_page) encrypt the whole page body: levels and values together.The current text supports both readings.
Encryption.mdsays "the results of compression of column pages are encrypted", but V2 levels are never compressed. ThePageHeader.crcdoc describes the body as "levels, then values (optionally compressed, optionally encrypted)".This PR proposes encrypting the entire page body, for these reasons:
What changes are included in this PR?
Encryption.md:compressed_page_sizeis the on-disk size of the module, including the 4-byte length and the encryption overhead.uncompressed_page_sizeand the V2 level byte lengths refer to the decrypted body.parquet.thrift: comment-only updates toDataPageHeaderV2andPageHeader.crcto match.Do these changes have PoC implementations?
Arrow C++ and arrow-rs already follow this behaviour. parquet-java needs a matching change to encrypt the levels on write and read the legacy layout on read. I'll open that as a follow-up.
Closes #636