-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix bug in ParquetMetaDataReader and add test of suffix metadata reads with encryption
#7372
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
Conversation
| // need to slice off the footer or decryption fails | ||
| self.decode_footer_metadata(&meta.slice(0..length), &footer)?, | ||
| None, |
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.
Does this indeed fail the added test if not changed? So it's not just adding a test it's fixing a bug?
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.
Yes...without this change the added test fails.
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.
I verified that without this change the new test fails like this:
---- file::metadata::reader::async_tests::test_suffix_with_encryption stdout ----
thread 'file::metadata::reader::async_tests::test_suffix_with_encryption' panicked at parquet/src/file/metadata/reader.rs:1458:14:
called `Result::unwrap()` on an `Err` value: General("Provided footer key and AAD were unable to decrypt parquet footer")
ParquetMetaDataReader and add test of suffix metadata reads with encryption
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 @etseidl , @adamreeve and @kylebarron
| // need to slice off the footer or decryption fails | ||
| self.decode_footer_metadata(&meta.slice(0..length), &footer)?, | ||
| None, |
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.
I verified that without this change the new test fails like this:
---- file::metadata::reader::async_tests::test_suffix_with_encryption stdout ----
thread 'file::metadata::reader::async_tests::test_suffix_with_encryption' panicked at parquet/src/file/metadata/reader.rs:1458:14:
called `Result::unwrap()` on an `Err` value: General("Provided footer key and AAD were unable to decrypt parquet footer")
|
Thanks everyone. |
Which issue does this PR close?
None
Rationale for this change
While working on #7369 I found an issue with doing suffix reads of the metadata coupled with encryption.
What changes are included in this PR?
Slice the footer off the buffer before passing it on to the decode function, as is done several lines below.
Added a test that fails if the change around line 713 is reverted.
Are there any user-facing changes?
No