Parent: #23393
Context: PR comment
Goal
Make partial group-ordering memory accounting include the retained allocation
for its Vec<ScalarValue> sort key.
Invariant / contract
GroupOrderingPartial::heap_size() reports the retained heap allocations owned
by its state. For an in-progress state, this includes the sort-key vector's
allocated capacity and heap allocations owned by its initialized scalar
elements, each exactly once. It does not add an inline descriptor already
charged by GroupOrdering::size().
Tasks
Acceptance criteria
Tests / verification
- Add or update the focused
GroupOrderingPartial tests in
datafusion/physical-plan/src/aggregates/order/partial.rs.
- Run
cargo test -p datafusion-physical-plan.
- Run
./ci/scripts/doc_prettier_check.sh --write --allow-dirty for this
Markdown change.
Dependencies / blockers
Keep the descriptor accounting established by the GroupOrdering owner
separate from this retained-capacity fix.
Parent: #23393
Context: PR comment
Goal
Make partial group-ordering memory accounting include the retained allocation
for its
Vec<ScalarValue>sort key.Invariant / contract
GroupOrderingPartial::heap_size()reports the retained heap allocations ownedby its state. For an in-progress state, this includes the sort-key vector's
allocated capacity and heap allocations owned by its initialized scalar
elements, each exactly once. It does not add an inline descriptor already
charged by
GroupOrdering::size().Tasks
State::heap_size()with capacity-awareDFHeapSizeaccounting, followingthe grouped
COUNTaccumulator's established approach.Vec<ScalarValue>capacity and aheap-owning scalar, proving spare slots and initialized scalar payloads are
accounted for without relying on allocator measurements.
descriptors or allocations owned by other ordering state again.
Acceptance criteria
even when the vector's live length is smaller.
ScalarValues remain included.unchanged.
Tests / verification
GroupOrderingPartialtests indatafusion/physical-plan/src/aggregates/order/partial.rs.cargo test -p datafusion-physical-plan../ci/scripts/doc_prettier_check.sh --write --allow-dirtyfor thisMarkdown change.
Dependencies / blockers
Keep the descriptor accounting established by the
GroupOrderingownerseparate from this retained-capacity fix.