apache / apache/arrow-rs

Missing safety comments for calling ArrowDataBuilder::build_unchecked in Parquet

Open
#7,044 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
3.6k
Forks
1.3k
Avg merge
2d 18h
Merged PRs (30d)
169

Description

**Describe the bug**
There are some places in the Parquet codes (mostly in arrow interfaces, e.g., [here](https://github.com/apache/arrow-rs/blob/main/parquet/src/arrow/array_reader/list_array.rs#L227) and [here](https://github.com/apache/arrow-rs/blob/main/parquet/src/arrow/array_reader/primitive_array.rs#L182)) calling the [ArrowDataBuilder::build_unchecked](https://github.com/apache/arrow-rs/blob/main/arrow-data/src/data.rs#L1902-L1906) without clear safety comments. In particular, it is not straightforwardly clear that whether the inputs do form valid Arrow Array.

**To Reproduce**
n/a

**Expected behavior**
Calling unsafe functions should have clear safety comments

**Additional context**

Contributor guide

Open the contributing guide

Research direction

Start with the call sites in parquet/src/arrow/array_reader/list_array.rs and primitive_array.rs, then read ArrowDataBuilder::build_unchecked in arrow-data/src/data.rs to understand its safety requirements. Search the Parquet code for other calls and add clear comments explaining why each input forms a valid Arrow array; the work is done when all relevant calls document their safety assumptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.