You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2026/10/18 12:18:13 UTC
[PR] docs: Explain the role of `EnsureRequirements` in the physical optimizer pipeline [datafusion]
alamb opened a new pull request, #26479:
URL: https://github.com/apache/datafusion/pull/26479
## Which issue does this PR close?
- Part of https://github.com/apache/datafusion/pull/26351 (split out so it can be reviewed and merged independently)
## Rationale for this change
While reviewing #26351 we noted that `EnsureRequirements` is special among the physical optimizer rules: it is what turns the initial, unexecutable physical plan into one whose distribution and ordering requirements are satisfied. Omitting it, or placing it wrongly in a custom pipeline, can produce a plan that is not runnable or returns incorrect results. That fact was not documented on the rule itself, so projects that build custom optimizer pipelines had no easy way to discover it.
## What changes are included in this PR?
Documentation only, in `datafusion/physical-optimizer/src/ensure_requirements/mod.rs`:
- Adds a "Placement in the Optimizer Pipeline" section to the module docs explaining why this rule is required and what happens if a pipeline omits it
- Expands the `EnsureRequirements` struct docs to name the `ExecutionPlan` methods whose requirements it enforces
## What is the testing strategy for this PR?
No tests: documentation only. `cargo doc -p datafusion-physical-optimizer` passes with `RUSTDOCFLAGS="-D warnings"`, so all intra-doc links resolve.
## Are there any user-facing changes?
No, only rustdoc text.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] docs(minor): Explain the role of `EnsureRequirements` in the physical optimizer pipeline [datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #26479:
URL: https://github.com/apache/datafusion/pull/26479
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] docs: Explain the role of `EnsureRequirements` in the physical optimizer pipeline [datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #26479:
URL: https://github.com/apache/datafusion/pull/26479#discussion_r4306988233
##########
datafusion/physical-optimizer/src/ensure_requirements/mod.rs:
##########
@@ -18,9 +18,13 @@
//! [`EnsureRequirements`] optimizer rule that enforces distribution and
//! sorting requirements together so that the two never invalidate each other.
//!
-//! This rule replaces the separate `EnforceDistribution` + `EnforceSorting`
Review Comment:
I also removed comments about how the code used to be structured as I don't think that is relevant anymore
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] docs(minor): Explain the role of `EnsureRequirements` in the physical optimizer pipeline [datafusion]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #26479:
URL: https://github.com/apache/datafusion/pull/26479#issuecomment-6250064122
## [Codecov](https://app.codecov.io/gh/apache/datafusion/pull/26479?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 82.89%. Comparing base ([`3d9037c`](https://app.codecov.io/gh/apache/datafusion/commit/3d9037cb0fdc4965cd4fd5ea1f5e6f5ff7927856?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`56b2dba`](https://app.codecov.io/gh/apache/datafusion/commit/56b2dba12725ab32187e03cdac8f2443b0434cce?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #26479 +/- ##
==========================================
- Coverage 82.89% 82.89% -0.01%
==========================================
Files 1154 1154
Lines 457961 457961
Branches 457961 457961
==========================================
- Hits 379637 379623 -14
- Misses 55285 55298 +13
- Partials 23039 23040 +1
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/datafusion/pull/26479?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org