mbutrovich commented on code in PR #26593:
URL: https://github.com/apache/datafusion/pull/26593#discussion_r4634075097
##########
datafusion/physical-expr/src/partitioning.rs:
##########
@@ -165,8 +167,8 @@ impl Display for Partitioning {
///
/// Like other user-specified data properties such as sortedness, if a source
/// declares range partitioning, it is responsible for placing each row in the
-/// partition described by the split points. DataFusion will not validate this
is
-/// upheld.
+/// partition described by the split points and bounds. DataFusion will not
+/// validate that a source upholds this contract.
Review Comment:
This sentence covers sources, but your `TestProjectionExec` case
([enforce_distribution.rs](https://github.com/apache/datafusion/blob/b25c830c48aba597a778772c2447503885f98565/datafusion/core/tests/physical_optimizer/enforce_distribution.rs#L2403-L2473))
shows that an operator overriding its output partitioning carries the same
responsibility, and that nothing downstream catches a mistake.
`EnforceDistribution` compares range layouts with
[`has_same_layout`](https://github.com/apache/datafusion/blob/b25c830c48aba597a778772c2447503885f98565/datafusion/physical-optimizer/src/ensure_requirements/enforce_distribution.rs#L1569-L1571),
which ignores bounds. Could we say both here, so an operator author learns it
from the docs instead of from wrong results?
```suggestion
/// Like other user-specified data properties such as sortedness, a plan that
/// declares range partitioning is responsible for placing each row in the
/// partition described by the split points and bounds. This applies to
sources
/// and to operators that override their output partitioning. DataFusion
will not
/// validate that a plan upholds this contract. `EnforceDistribution`
compares
/// layouts with [`Self::has_same_layout`], which ignores bounds, so it never
/// inserts a filter or repartition because of them.
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]