-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[Parquet] Provide only encrypted column stats in plaintext footer #8305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
5842cdb
Initial commit
rok 51cc3ba
rebase
rok 6ca47ce
rebase and adjust to refactor
rok 936935c
tmp
rok 28dfb3a
Remove statistics just prior to thrift serialization
rok fb8cb39
minor change
rok d895be7
test writer produced metadata
rok b9b0786
DRY
rok 65c473d
not there yet
rok d799d9f
work
rok 3ab8d35
Add test_read_subset_of_encrypted_columns_with_plaintext_footer
rok 89ade86
Encrypt ColumnChunk metadata, only encode stats to thrift if no encry…
rok 1e58ee2
Fix plaintext footer statistics handling for encrypted columns
rok e6f41f4
lint
rok 3b2c31c
Refactor tests and add extra test cases
adamreeve ef2cedb
Clippy fix
adamreeve 93b1a98
review feedback
rok 91f23f1
clippy
rok dd55539
work
rok 1b74fb1
Apply suggestion from @adamreeve
rok 11738ce
review feedback
rok ca315df
Review feedback
rok e14520e
Review feedback
rok 688f7c6
lint
rok 2bf1e29
clarifying comment
rok 237e04e
Merge remote-tracking branch 'apache/main' into plaintext_statistics
alamb f434c86
set ArrowReaderOptions.with_encoding_stats_as_mask(false)
rok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the idea here to only write the required bits of the column meta_data so readers won't complain? If so, then should all of the fields below also be skipped?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I agree all the below fields should be skipped too.
I checked what the C++ implementation does and it's actually a bit different between the plaintext footer case and when the footer is encrypted but the column is encrypted with a different key: https://github.com/apache/arrow/blob/cbd36b817fc77812f8df1a15bf24314de3b27f29/cpp/src/parquet/metadata.cc#L1748-L1755.
When there's a plaintext footer, only the
statisticsandencoding_statsare stripped out of the unencrypted metadata, similar to what we're proposing here. But when the footer is also encrypted, it's assumed that the reader can handle when the wholemetadatafield isn't set so this is completely skipped, which is what was done before.It might make sense to match what C++ does and keep the previous behaviour of excluding the full
ColumnChunkmetadatafield when the footer is encrypted, and check that the reader can handle this when it doesn't have the column key. That should have the benefit of not increasing the footer size too much. And then in the plaintext footer case, also exclude the other fields below.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @etseidl !
I've moved the other sensitive metadata into the conditional and added tests. (except for geospatial since it requires
#[cfg(feature = "geospatial")]and it seems straightforward enough to not cover here?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rok, looks good now. I'll leave it to @adamreeve if we want to revert to excluding the
meta_dataentirely when the footer is encrypted.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per @adamreeve suggestion this now omits metadata in case encrypted metadata is present and strips out stats if it is not.