comphead commented on code in PR #27351:
URL: https://github.com/apache/datafusion/pull/27351#discussion_r4632740798


##########
datafusion/physical-plan/src/aggregates/skip_partial.rs:
##########
@@ -30,7 +30,9 @@ pub(super) struct SkipAggregationProbe {
     // ========================================================================
     /// Number of processed input rows (updated during probing)
     input_rows: usize,
-    /// Number of total group values for `input_rows` (updated during probing)
+    /// Number of groups created for `input_rows` (updated during probing).
+    /// A key that returns after an early emit is counted again, so this is the
+    /// number of rows the stream outputs for `input_rows`.

Review Comment:
   Updated in c3c7072c4, together with `configs.md` and the copy in 
`information_schema.slt`. I rebased on `main` for it, since #27438 reformatted 
`configs.md`.
   
   Whether your example skips depends on the key order. With keys that cycle 
every 20K rows (`value % 20000`), the 8M fair pool flushes before any key 
repeats. `main` emits early 2.44K times and outputs all 20M rows, and this PR 
skips, which takes the query from about 0.08 s to 0.04 s. With the issue's 
shuffled `k_m % 20011` the table still merges 41%, so the probe keeps 
aggregating.
   



##########
datafusion/physical-plan/src/aggregates/hash_stream.rs:
##########


Review Comment:
   Filed #27591. It covers the key-pattern case from this thread and a skip 
that starts during a burst of memory pressure. Re-probing was already point 3 
of #22405, and the panic that deferred it there looks like the one #27501 fixed.
   



-- 
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]

Reply via email to