apache / apache/arrow-rs

Enhance arrow-json reader/writer builder pattern to enforce constraints

Open
#7,025 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
3.6k
Forks
1.3k
Avg merge
2d 14h
Merged PRs (30d)
167

Description

#6643 introduced new options which affect existing options in the builders.

- Reference: https://github.com/apache/arrow-rs/pull/6643/#pullrequestreview-2564347496

Examples:

```rust
let reader = ReaderBuilder::new(schema)
.with_struct_mode(StructMode::ListOnly)
.with_strict_mode(false) // This has no effect
.build();

let writer = WriterBuilder::new()
.with_struct_mode(StructMode::ListOnly)
.with_explicit_nulls(false) // This has no effect
.build()
```

See if we can utilize Rust's type system to enforce these constraints (e.g. type-state builder pattern). Would likely require a breaking API change.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing PR #6643 and the ReaderBuilder and WriterBuilder APIs described in this issue. Evaluate whether Rust’s type-state builder pattern can enforce the interactions among struct mode, strict mode, and explicit nulls; done means the invalid option combinations are rejected by the API, with any breaking change clearly accounted for.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.