dhruvxvaishnav opened a new pull request, #10627: URL: https://github.com/apache/arrow-rs/pull/10627
# Which issue does this PR close? - Closes #10613. # Rationale for this change When `FileReader` uses a projection, the batches contain the projected schema but `RecordBatchReader::schema()` returns the complete file schema. This makes the schema reported by the reader inconsistent with the batches it produces. # What changes are included in this PR? - Store the projected output schema on `FileReader` while keeping the complete schema in `FileDecoder` for decoding. - Return the projected schema from `FileReader::schema()`. - Validate projection indices when constructing the reader. - Add regression tests for projected schemas and invalid projections. # Are these changes tested? Yes. I ran: - `cargo test -p arrow-ipc --all-features` - `cargo test -p arrow --all-features` - `cargo clippy -p arrow-ipc --all-targets --all-features -- -D warnings` - `cargo +stable fmt --all -- --check` # Are there any user-facing changes? Yes. Projected IPC file readers now report the same schema as the record batches they produce. There are no public API signature changes. AI assistance: OpenAI Codex assisted with codebase exploration, implementation support, test preparation, and validation. I reviewed and validated the changes and remain responsible for understanding and maintaining them. -- 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]
