srijithr03 opened a new pull request, #10903:
URL: https://github.com/apache/arrow-rs/pull/10903
## Which issue does this PR close?
Closes #10578.
## Rationale for this change
`arrow-csv` currently supports recovering rows with fewer fields than the
schema through `with_truncated_rows(true)`, but rows with more fields always
return an error.
This change adds an opt-in `ExtraFields::Ignore` mode that keeps the fields
defined by the schema and ignores trailing extra fields.
The default behavior remains `ExtraFields::Error`, preserving existing
behavior.
## What does this PR do?
- Add `ExtraFields::{Error, Ignore}` configuration.
- Add `ReaderBuilder::with_extra_fields()`.
- Limit CSV field-end storage to the expected fields for the current row.
- Ignore trailing fields when `ExtraFields::Ignore` is enabled.
- Add regression tests for extra fields, quoted fields, and chunk
boundaries.
## Tests
- `cargo fmt --all -- --check`
- `cargo test -p arrow-csv`
- `cargo clippy -p arrow-csv --all-targets --all-features -- -D warnings`
--
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]