ulrichurriola-parada-ops opened a new pull request, #24271:
URL: https://github.com/apache/datafusion/pull/24271
## Which issue does this PR close?
- Closes #.
## Rationale for this change
HashJoinExec's elapsed_compute metric (as reported by EXPLAIN ANALYZE and
ExecutionPlanMetricsSet) includes time spent executing the entire build-side
subtree, not just the join's own work. Any tool that sums elapsed_compute
across a physical plan to estimate total CPU time (e.g. to build a
cost/telemetry model) will double-count that subtree's compute: once under the
child operator(s) that did the work, and again under HashJoinExec.
## What changes are included in this PR?
build_time was previously timed around the entire collect_left_input future
(via left_fut.get_shared(cx) in collect_build_side). That future both drains
the build-side child's stream and builds the hash table, so the child's own
compute got billed to build_time whenever the driving partition executed both
phases inline.
- Scoped the build_time timer inside collect_left_input to start only
after the build-side stream has been fully folded, covering just the
synchronous bounds/hash-map construction.
- Removed the now-redundant wrapping timer in collect_build_side.
## Are these changes tested?
Covered by the existing hash_join test suite (correctness of join output and
other metrics is unaffected). No new test was added to assert the exact
build_time/elapsed_compute value, since there isn't currently a way to
attribute deterministic wall-clock cost to a specific subtree in a unit test.
## Are there any user-facing changes?
elapsed_compute reported for HashJoinExec (e.g. via EXPLAIN ANALYZE) will be
smaller and more accurate, reflecting only the join's own compute rather than
including its build-side subtree. No public API changes.
--
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]