Makes me wonder if `build_to_thrift` should return an `Option`, to make sure callers don't forget to check `.valid()`.
- Dominant language
- Rust
- Stars
- 3.6k
- Forks
- 1.3k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 168
Description
**Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
@progval pointed out that the current API for building `ColumnIndex` requires users to remember to call `valid()`
Makes me wonder if `build_to_thrift` should return an `Option`, to make sure callers don't forget to check `.valid()`.
_Originally posted by @progval in https://github.com/apache/arrow-rs/pull/6042#discussion_r1677417033_
**Describe the solution you'd like**
Change [`ColumnIndexBuilder::build_to_thrift`](https://docs.rs/parquet/latest/parquet/file/metadata/struct.ColumnIndexBuilder.html#method.build_to_thrift) so it returns `Option` - specifically `None` if `valid()` is false
**Describe alternatives you've considered**
**Additional context**
Contributor guide
Research direction
Start with the ColumnIndexBuilder::build_to_thrift API documentation linked in the issue, then inspect its implementation, valid(), and all callers. The change is complete when invalid builders return None, callers handle the Option, and the relevant Rust tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- data-engineering
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100