minor: document EquivalenceProperties::project - #24063
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Expands the rustdoc for EquivalenceProperties::project to clarify the semantics of how equivalence properties survive projection, especially around ordering preservation via order-preserving expressions.
Changes:
- Rewrites the method doc comment to describe how orderings, equivalence classes, and constraints are projected.
- Documents the key condition that orderings are only preserved through order-preserving expressions determined by
SortProperties. - Notes that non-representable expressions/orderings are dropped when they can’t be expressed in the projected schema.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// - Orderings: an existing ordering is carried to a target only when the | ||
| /// mapping expression is order-preserving for it, as determined from the | ||
| /// expression's [`SortProperties`]. For example, an ordering on `c` is | ||
| /// preserved through `c + 1` but dropped through `abs(c)`. Orderings | ||
| /// implied by the mapping are also derived, e.g. an ordering on `a + b` | ||
| /// yields one on the projected `a_new + b_new`. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #24063 +/- ##
==========================================
- Coverage 80.87% 80.87% -0.01%
==========================================
Files 1101 1101
Lines 375765 375765
Branches 375765 375765
==========================================
- Hits 303915 303904 -11
- Misses 53747 53753 +6
- Partials 18103 18108 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Rationale for this change
EquivalenceProperties::projectis a central, widely-called method, but its doc comment was a single line ("Projects the equivalences within according tomappingandoutput_schema"). That does not convey that it carries orderings, the equivalence group, and constraints through the mapping, nor the key subtlety that an ordering is preserved only through an order-preserving expression (SortProperties). This tripped me up while reasoning about why an ordering survived a projection containing computed expressions, so I expanded the docs.What changes are included in this PR?
Documentation only. Expands the rustdoc on
EquivalenceProperties::projectto describe:SortProperties(e.g. preserved throughc + 1, dropped throughabs(c); compound orderings likea + bmap toa_new + b_new);output_schemaare dropped.Are these changes tested?
No code change.
cargo doc -p datafusion-physical-expr --no-depsbuilds cleanly withRUSTDOCFLAGS="-D warnings".Are there any user-facing changes?
Documentation only.