nikolas-sapa opened a new pull request, #26246:
URL: https://github.com/apache/datafusion/pull/26246
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases. You can
link an issue to this PR using the GitHub syntax. For example `Closes #123`
indicates that this PR will close issue #123.
-->
- Closes #19045.
- Part of #16602 (add a user-guide page documenting operator metrics).
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in
the
issue then this section is not needed. Explaining clearly why changes are
proposed helps reviewers understand your changes and offer better
suggestions
for fixes.
-->
#16602 asks for a documentation page covering the runtime metrics each
operator
exposes. `FilterExec` (#19043) and `HashJoinExec` are already documented;
`NestedLoopJoinExec` was left as an unchecked item on that list. Without the
page entry, the meaning of the build-probe and spill metrics a nested-loop
join
reports in `EXPLAIN ANALYZE` can only be found by reading the operator
source.
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is
sometimes worth providing a summary of the individual changes in this PR.
-->
Adds a `NestedLoopJoinExec` section to `docs/source/user-guide/metrics.md`,
in
the same shape as the existing `FilterExec` and `HashJoinExec` sections:
- the shared build-probe metrics (`build_time`, `build_input_batches`,
`build_input_rows`, `build_mem_used`, `join_time`, `input_batches`,
`input_rows`) and the join-level `selectivity` metric
(output_rows / (left_rows * right_rows))
- the spill metrics (`spill_count`, `spilled_bytes`, `spilled_rows`) that the
operator surfaces during memory-limited execution, with a short explanation
of when that mode kicks in
- a note that `selectivity` is a `Summary`-level metric while the other
operator-level metrics are `Dev` metrics
Every description was cross-checked against the source rather than written
from
imagination: the `BuildProbeJoinMetrics` doc comments in
`datafusion/physical-plan/src/joins/utils.rs`, `NestedLoopJoinMetrics` in
`joins/nested_loop_join.rs` (including where `selectivity.add_total` /
`add_part` are updated), `SpillMetrics` in `datafusion-physical-expr-common`,
and `MetricValue::name()` for the `spill_count` field name.
## Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are
they
covered by existing tests)?
-->
Documentation only, no code changes — no new tests needed. Formatting was
verified with `./ci/scripts/doc_prettier_check.sh` (clean).
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR. If there are any breaking changes to public
APIs, please add the `api change` label.
-->
User-facing documentation only: the metrics user-guide page now documents
`NestedLoopJoinExec` metrics. No API or behavior changes.
## AI assistance disclosure
This PR was prepared with the assistance of an AI coding agent. Per the
[AI policy](https://datafusion.apache.org/contributor-guide/ai-policy.html):
I have personally read the entire diff above, verified every metric name and
description against the operator source listed in "What changes are
included",
and I understand the selection (build-probe metrics shared via
`BuildProbeJoinMetrics`, the Summary-level `selectivity` ratio recorded in
`NestedLoopJoinMetrics`, and `SpillMetrics` during memory-limited execution)
end-to-end. I am happy to respond to review comments myself and to adjust any
wording the reviewers prefer.
--
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]