Repository navigation
Commit 7833125
authored
docs: show array_distinct keeping first-seen order (#25930)
## Which issue does this PR close?
- None; documentation fix.
## Rationale for this change
The `array_distinct` example says `select array_distinct([1, 3, 2, 3, 1,
2, 4])` returns `[1, 2, 3, 4]`. It returns `[1, 3, 2, 4]`: #20364
changed it to keep elements in the order they first appear, matching
`array_union` and `array_intersect`, and the example was not updated.
## What changes are included in this PR?
The `#[user_doc]` example and description in `set_ops.rs`, the matching
code comment, and `scalar_functions.md` regenerated with
`./dev/update_function_docs.sh`. Also a sqllogictest case for the order,
since every existing `array_distinct` case used input whose sorted and
first-seen orders coincide.
## What is the testing strategy for this PR?
Ran the example against `datafusion-cli` built from `main`. The new case
in `array_distinct.slt` passes; `cargo fmt --check`, `cargo clippy -p
datafusion-functions-nested --all-targets -- -D warnings` and
`./ci/scripts/doc_prettier_check.sh` pass.
## Are there any user-facing changes?
Documentation and a test only.
Generated with Claude Code (claude-opus-5-5); I checked the output
above.1 parent d9d7be8 commit 7833125
3 files changed
Lines changed: 19 additions & 13 deletions
File tree
- datafusion
- functions-nested/src
- sqllogictest/test_files/array
- docs/source/user-guide/sql
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3644 | 3644 | | |
3645 | 3645 | | |
3646 | 3646 | | |
3647 | | - | |
| 3647 | + | |
3648 | 3648 | | |
3649 | 3649 | | |
3650 | 3650 | | |
| |||
3658 | 3658 | | |
3659 | 3659 | | |
3660 | 3660 | | |
3661 | | - | |
3662 | | - | |
3663 | | - | |
3664 | | - | |
3665 | | - | |
| 3661 | + | |
| 3662 | + | |
| 3663 | + | |
| 3664 | + | |
| 3665 | + | |
3666 | 3666 | | |
3667 | 3667 | | |
3668 | 3668 | | |
| |||
0 commit comments