Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachelint committed Aug 13, 2024
1 parent 809ddc9 commit 76f5aba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ impl GroupsAccumulatorAdapter {
let new_accumulators = input_batch_size - self.convert_state_buffer.len();
for _ in 0..new_accumulators {
let accumulator = (self.factory)()?;
let state = AccumulatorState::new(accumulator);
self.add_allocation(state.size());
self.states.push(state);
self.convert_state_buffer.push(accumulator);
}

self.adjust_allocation(
Expand Down
11 changes: 11 additions & 0 deletions datafusion/sqllogictest/test_files/aggregate_skip_partial.slt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ GROUP BY 1, 2 ORDER BY 1 LIMIT 5;
-2117946883 d -2117946883 NULL NULL NULL
-2098805236 c -2098805236 NULL NULL NULL

query I
SELECT MEDIAN(c5)
FROM aggregate_test_100
GROUP BY c1 ORDER BY c1 LIMIT 5;
----
623103518
41423756
-382483011
16122795
427197269

# Prepare settings to always skip aggregation after couple of batches
statement ok
set datafusion.execution.skip_partial_aggregation_probe_rows_threshold = 10;
Expand Down

0 comments on commit 76f5aba

Please sign in to comment.