apache / apache/datafusion

Better API for `Expr::sort(bool, bool); // acktually BOOL BOOL`

Open
#20,227 2 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

Current implementation:

```rust
// all docs about `sort` is always followed by a comment
col("a").sort(true, false); // yeah but a bit no
col("a").sort(false, true); // no but also yeah
col("a").sort(true, true); // hell yeah
col("a").sort(false, false); // hell no
```

vs.

Suggested implementation:

```rust
// pick a better poison
col("a").sort(SortOpt::AscNullFirst); // can't believe
col("a").sort(SortOpt{ asc: true, null_first: false }); // you guessed it
col("a").sort().asc().null_first(); // without comments!
```

Contributor guide

Open the contributing guide

Research direction

Start at the Expr::sort(bool, bool) API and compare the proposed SortOpt and builder-style alternatives shown in the issue. Clarify which API is wanted, then identify the affected callers and validation coverage; done means an agreed replacement for the ambiguous boolean arguments with its behavior covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.