skyon0522-ai opened a new pull request, #3867: URL: https://github.com/apache/parquet-java/pull/3867
Closes #3043. ### Rationale for this change The attached nanoparquet file uses PLAIN in the V1 repetition/definition encoding fields for flat required columns. Neither level stream is present. `readPageV1` nevertheless selects a reader from each header encoding, which can consume value bytes or fail at `ValuesReader.readInteger` before the first record is returned. The [format specification](https://github.com/apache/parquet-format/blob/53b8bd8576827080d4382fa457003f45b41cda6e/README.md#L193-L200) specifies that these zero-maximum level streams are omitted. ### What changes are included in this PR? Select the existing `ZeroIntegerValuesReader` independently when the corresponding maximum level is zero. Keep the existing encoding dispatch for nonzero levels. The regression uses the upstream V1 writer to generate two pages, replaces only unused level-encoding fields, and checks exact values and levels for required, optional and repeated columns. ### Are these changes tested? Validation on Linux (Ubuntu 24.04, Java 17.0.20.1, Maven 3.9.11): - The new parameterized cases produced four errors on unchanged production code. The two controls and seven existing cases passed. All 13 passed with the fix. - The full `parquet-column` reactor test run passed all 1,094 tests. - A separate 92-test Hadoop run passed, including reading all 32 rows of the issue attachment through both reader APIs and a generated control. - Spotless checks for the two changed files, normal RAT checks across eight reactor modules, and `git diff --check` passed. The entire root reactor, native Windows and macOS were not tested. ### Are there any user-facing changes? Files such as the issue attachment become readable when a V1 header uses PLAIN for an omitted level stream. OpenAI Codex assisted with the implementation and tests. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
