Repository navigation
fix(parquet): preserve CTR algorithm in plaintext footers - #1412
Conversation
zeroshade
left a comment
There was a problem hiding this comment.
Thanks — a clean fix. Writing encryptProps.Algorithm() directly matches the encrypted-footer path (GetFileCryptoMetaData), and dropping the special-casing of AadPrefix is safe because the properties only carry a prefix when it's stored in the file. The test covers both ciphers across encrypted/plaintext footers and stored/external AAD, and the three CTR plaintext cases fail without the fix. The signature check confirms footer signing still uses GCM.
Minor, non-blocking: this repo prefers folding new tests into an existing test file where one fits, and using memory.NewCheckedAllocator in reader tests.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Arrow maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Arrow handles maintainer review:
CONTRIBUTING.md.
|
Moved the regression into
|
Rationale for this change
Writing an AES_GCM_CTR_V1 file with a plaintext footer currently records AES_GCM_V1 in the footer metadata. Readers then select GCM for the CTR data pages and fail to read them. This also reproduces with arrow-go v18.8.0.
Related to #566 and apache/arrow#54884.
What changes are included in this PR?
Serialize the configured file algorithm directly, preserving its AAD settings. Footer signing is unchanged.
Add a generated-file regression for both algorithms, encrypted and plaintext footers, and stored or externally supplied AAD prefixes. It checks serialized metadata and round-trip values, plus rejection of a corrupted plaintext-footer signature.
Are these changes tested?
The regression fails on the original code in all three CTR/plaintext cases and passes with the fix.
-race -tags assert. The focused regression also passes withassert,noasm.Are there any user-facing changes?
New CTR files with plaintext footers declare the correct cipher and can be read back. No API changes.
AI was used for the implementation, tests and PR description.