fix: Fix peak memory display in EXPLAIN ANALYZE for multiple operators#23140
fix: Fix peak memory display in EXPLAIN ANALYZE for multiple operators#231402010YOUY01 wants to merge 1 commit into
EXPLAIN ANALYZE for multiple operators#23140Conversation
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
It suggests to use Then downstream crate must include wildcard I think it's better to keep it as a breaking change and require downstreams to update. |
alamb
left a comment
There was a problem hiding this comment.
Looks like a nice change to me -- thanks @2010YOUY01
I do think we should change the order of the FFI enum before merge
| name: SString, | ||
| gauge: u64, | ||
| }, | ||
| PeakMemoryUsage { |
There was a problem hiding this comment.
I think this enum needs to go at the end of the enum, not the middle, per
datafusion/datafusion/ffi/src/physical_expr/metrics.rs
Lines 27 to 28 in 833a91a
Which issue does this PR close?
Rationale for this change
See reproducer in
datafusion-cli:See
HashJoinExec: ... build_mem_used=2.80 B, it actually means 2.8 billion bytes, but it looks quite misleading. This PR fixes it:The reason is those metrics are tracking peak memory usage for a operator in the query lifecycle, so it's using
Gaugemetrics type, but how to choose display format become tricky (bytes or count?)This PR adds a new
Metrictype, that wraps the existingGauge, and use it to represent 'gauge for memory bytes', this fixes the bytes display issue.What changes are included in this PR?
MetricValue::PeakMemoryUsageto address the above issueAre these changes tested?
Are there any user-facing changes?