Core, Parquet: Fix Parquet to work OutputFiles generated by StandardEncryptionManager.ecrypt().encryptingOutputFile() #14528
+96
−5
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.
The
EncryptedOutputFileobjects generated by theStandardEncryptionManager.encryptmethod hide the underlyingOutputFile.Unfortunately, there are some hidden requirements in the Parquet implementation for encryption to work properly.
Parquet encryption was only functioning when the target was a
HadoopOutputFile. UsingStandardEncryptedOutputFile.encryptingOutputFile()produced anAesGcmOutputFile, which resulted in corrupt files.Updated
StandardEncryptedOutputFileto return itself as theencryptingOutputFile, instead of exposing the underlyingAesGcmOutputFile. The methods coming from theOutputFileare now wrapped and return the values directly from the wrapped output file.Added a test to highlight the issue.
The test currently fails without the patch, but successful if we change:
to
After the patch both
OutputFileobjects could be used.