asolimando opened a new pull request, #25689:
URL: https://github.com/apache/datafusion/pull/25689
## Which issue does this PR close?
Closes #25653.
## Rationale for this change
`ExecutionPlan::partition_statistics` is deprecated in favor of
`StatisticsContext::compute`,
but `compute` had no usage example, only prose docs.
## What changes are included in this PR?
- Add a runnable `# Example` to `StatisticsContext::compute` showing both
whole-plan and
per-partition statistics computation.
- Extend the `StatisticsExec` test mock with an optional per-partition
statistics builder
(`with_partition_statistics`), so the example's per-partition case returns
real statistics
instead of always falling back to `Statistics::new_unknown`.
## Are these changes tested?
Yes, the new doc comment is a doctest, verified by `cargo test --doc`.
## Are there any user-facing changes?
No, this is a documentation-only change to a public API's doc comment, plus
a test-only mock
extension.
----
Disclaimer: I used AI to assist in the code generation, I have manually
reviewed the output and it matches my intention and understanding.
--
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]