Skip to content

fix(parquet): validate schema child count before allocation - #12025

Closed
huong8373tt-beep wants to merge 1 commit into
apache:mainfrom
huong8373tt-beep:fix/parquet-schema-child-count
Closed

huong8373tt-beep wants to merge 1 commit into
apache:mainfrom
huong8373tt-beep:fix/parquet-schema-child-count

Conversation

@huong8373tt-beep

@huong8373tt-beep huong8373tt-beep commented Nov 1, 2026 •

Copy link
Copy Markdown

Rationale

The row-group list path now validates its declared count before reserving capacity, but the schema conversion path still used SchemaElement.num_children as a Vec capacity without checking it against the remaining flattened schema elements. A malformed Parquet footer could therefore request a very large allocation.

Changes

  • Validate SchemaElement.num_children against the remaining schema elements before allocating.
  • Add a regression test for an i32::MAX child count.

Testing

  • cargo fmt --all -- --check
  • cargo test -p parquet schema::types::tests --lib
  • cargo test -p parquet file::metadata::thrift::tests::row_group_count_exceeding_remaining_input_is_rejected --lib

Addresses the remaining schema-path issue in #11954.

AI disclosure

Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.

Signed-off-by: Slai.life <huong8373tt@gmail.com>
@github-actions github-actions Bot added parquet Changes to the parquet crate bug labels Nov 1, 2026
@etseidl

etseidl commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Thank you for the contribution. The change may well be correct, but I am closing this PR under the arrow-rs guidance on AI generated submissions: https://github.com/apache/arrow-rs/blob/main/CONTRIBUTING.md#ai-generated-submissions

Maintainer review time is the scarcest resource in this project. This account has recently opened many AI-generated PRs across many repositories. That suggests the changes aren't coming from someone who uses arrow-rs, and that no human will be around to discuss review feedback and maintain the code. Reviewing PRs like this costs us more time than it saves.

If you do use arrow-rs and this fix matters to you, please re-open this as a focused PR with a short description in your own words, one you have reviewed and understand, and we'd be happy to help with review.

@etseidl etseidl closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants