Skip to content

docs: show array_distinct keeping first-seen order - #25930

Open
rawsun007 wants to merge 2 commits into
apache:mainfrom
rawsun007:docs-array-distinct-order
Open

rawsun007 wants to merge 2 commits into
apache:mainfrom
rawsun007:docs-array-distinct-order

Conversation

@rawsun007

Copy link
Copy Markdown
Contributor

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.

apache#20364 made array_distinct preserve the order elements first appear in, but the example still showed sorted output.

Generated-by: Claude Code (claude-opus-5-5)
Every existing case had input whose sorted and first-seen orders coincide.

Generated-by: Claude Code (claude-opus-5-5)
@github-actions github-actions Bot added documentation Improvements or additions to documentation sqllogictest SQL Logic Tests (.slt) functions Changes to functions implementation labels Oct 1, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.58%. Comparing base (54e32bb) to head (7182e84).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #25930      +/-   ##
==========================================
- Coverage   82.58%   82.58%   -0.01%     
==========================================
  Files        1144     1144              
  Lines      443198   443198              
  Branches   443198   443198              
==========================================
- Hits       366024   366013      -11     
- Misses      54978    54986       +8     
- Partials    22196    22199       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation functions Changes to functions implementation sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants