Skip to content

docs: Add example and cross-links to GroupingEquivalenceClass - #27237

Merged
alamb merged 4 commits into
apache:mainfrom
alamb:alamb/grouping-class-docs
Nov 11, 2026
Merged

alamb merged 4 commits into
apache:mainfrom
alamb:alamb/grouping-class-docs

Conversation

@alamb

@alamb alamb commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • N/A, documentation only.

Rationale for this change

While reviewing #27191 I was researching how EquivalenceProperties tracks orderings and groupings, and wanted to write down what I learned so others do not have to repeat it.

The GroupingEquivalenceClass docs described the property in prose but had no example, and did not say how it relates to OrderingEquivalenceClass, which it parallels.

What changes are included in this PR?

Rustdoc only, in datafusion/physical-expr/src/equivalence/grouping.rs:

Split out of a larger documentation PR (#27234) for easier review.

What is the testing strategy for this PR?

CI

Are there any user-facing changes?

No.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions github-actions Bot added the physical-expr Changes to the physical-expr crates label Nov 8, 2026
@alamb
alamb marked this pull request as ready for review November 8, 2026 14:10
@alamb alamb added the documentation Improvements or additions to documentation label Nov 8, 2026

@NGA-TRAN NGA-TRAN left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice description of the feature. Thanks Andrew

Comment on lines +28 to +43
/// ┌───┬───┬───┐
/// │ a │ b │ c │
/// ├───┼───┼───┤
/// │ 2 │ 1 │ 5 │
/// │ 2 │ 1 │ 3 │
/// │ 1 │ 3 │ 4 │
/// │ 2 │ 2 │ 1 │
/// │ 2 │ 2 │ 2 │
/// └───┴───┴───┘
/// ```
///
/// * Is grouped by `[a, b]`, as rows with the same `(a, b)` are contiguous,
/// even though the table is not sorted by `a`, `b` nor `(a, b)`.
/// * Is grouped by `[b]`, since each value of `b` is in one run.
/// * Is NOT grouped by `[a]`, because `a = 2` appears in two separate runs.
///

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it also grouped by c, c,a, ...? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so for this example because c is distinct.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a new bullet

Is grouped by [c], and by any tuple that contains c such as [a, c],
/// because each value of c is distinct.

alamb and others added 3 commits November 10, 2026 20:21
@github-actions github-actions Bot removed the documentation Improvements or additions to documentation label Nov 11, 2026
@alamb
alamb enabled auto-merge November 11, 2026 14:21
@alamb

alamb commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks again @nuno-faria

@alamb
alamb added this pull request to the merge queue Nov 11, 2026
Merged via the queue into apache:main with commit fbc3895 Nov 11, 2026
44 checks passed
@alamb
alamb deleted the alamb/grouping-class-docs branch November 11, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-expr Changes to the physical-expr crates v57.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants