linyiru opened a new pull request, #12502:
URL: https://github.com/apache/arrow-rs/pull/12502

   # Which issue does this PR close?
   
   - Closes #12497.
   
   # Rationale for this change
   
   `ParquetRecordBatchReaderBuilder::build` panics with an index out of bounds 
when `with_row_groups` was given an index that is not a row group of the file. 
`build` returns a `Result`, and the push decoder reports the same input as an 
error.
   
   # What changes are included in this PR?
   
   `build` checks the row group indices before it uses them and returns `Row 
group index {idx} out of bounds for file with {n} row groups`, the message 
`ParquetMetaData::row_group_num_rows` and the push decoder use.
   
   # Are these changes tested?
   
   Yes. `test_row_group_index_out_of_bounds` asks for row groups 0 and 1 of a 
file with one row group and expects the error. On `main` it panics.
   
   # Are there any significant user-facing changes?
   
   `build` returns an error where it used to panic.
   
   # AI usage disclosure
   
   Claude Code found the problem while fuzzing the reader with corrupted files, 
and generated the fix, the test and this description. The test was run on 
`main` with and without the fix.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]

Reply via email to