Skip to content

fix(parquet): preserve CTR algorithm in plaintext footers - #1412

Open
autoCAT6 wants to merge 1 commit into
apache:mainfrom
autoCAT6:fix/parquet-plaintext-footer-cipher
Open

autoCAT6 wants to merge 1 commit into
apache:mainfrom
autoCAT6:fix/parquet-plaintext-footer-cipher

Conversation

@autoCAT6

Copy link
Copy Markdown

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.

  • All 18 Parquet packages pass with -race -tags assert. The focused regression also passes with assert,noasm.
  • Files from this commit read correctly with arrow-go v18.8.0, the C++ reader from GH-51669: [C++][Parquet] Preserve cipher in plaintext footer metadata arrow#54884, and parquet-java 1.18.1, including all column values.
  • Vet and lint pass for the changed packages. Apache RAT passes. Broader vet/lint checks report only the existing BitRun benchmark warning and three schema QF1001 suggestions, also reproduced on the unchanged base.

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.

@autoCAT6
autoCAT6 requested a review from zeroshade as a code owner October 23, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant