Repository navigation
Commit b8c4187
authored
test: add regression coverage for terminal hash aggregate drain (apache#24853)
## Which issue does this PR close?
- Closes apache#24849.
## Rationale for this change
apache#23182 fixed a performance regression in terminal hash aggregate output
by avoiding repeated destructive `EmitTo::First` calls. However, the
remaining `MaterializedAggregateOutput` unit test only exercises the
slicing helper and does not verify the behavior through `AggregateExec`.
A result-only integration test would pass with both the regressed and
fixed implementations, while a wall-clock assertion would be unreliable
in CI. This PR therefore uses a test `GroupsAccumulator` that returns an
error if terminal output falls back to destructive `EmitTo::First`.
## What changes are included in this PR?
- Adds `single_grouped_aggregate_avoids_destructive_terminal_drain`,
which runs unordered Single hash aggregation with more groups than the
configured `batch_size`.
- Verifies that `AggregateExec` selects `SingleHash`, emits multiple
bounded batches, and returns the correct aggregate results for repeated
group keys.
- Keeps the test independent of `MaterializedAggregateOutput`; Single
and Final hash aggregation exercise the same terminal drain helper.
## What is the testing strategy for this PR?
- Verified that temporarily restoring destructive
`EmitTo::First(batch_size)` causes the new test to fail with the
expected accumulator error, while the current implementation passes.
- Applied an equivalent FinalHash accumulator oracle to the historical
regression: it fails on `d58e0c6d4^` and passes on `d58e0c6d4`. The
migrated SingleHash stream did not exist at that historical revision.
- Ran `cargo fmt --all`.
- Ran `cargo clippy --all-targets --all-features -- -D warnings`.
- Ran the extended workspace test suite with
`avro,json,backtrace,extended_tests,recursive_protection,parquet_encryption`;
all tests passed after initializing the required Arrow and Parquet test
fixtures.
## Are there any user-facing changes?
No. This PR only adds regression test coverage.1 parent b3cb365 commit b8c4187
1 file changed
Lines changed: 67 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4352 | 4352 | | |
4353 | 4353 | | |
4354 | 4354 | | |
| 4355 | + | |
| 4356 | + | |
| 4357 | + | |
| 4358 | + | |
| 4359 | + | |
| 4360 | + | |
| 4361 | + | |
| 4362 | + | |
| 4363 | + | |
| 4364 | + | |
| 4365 | + | |
| 4366 | + | |
| 4367 | + | |
| 4368 | + | |
| 4369 | + | |
| 4370 | + | |
| 4371 | + | |
| 4372 | + | |
| 4373 | + | |
| 4374 | + | |
| 4375 | + | |
| 4376 | + | |
| 4377 | + | |
| 4378 | + | |
| 4379 | + | |
| 4380 | + | |
| 4381 | + | |
| 4382 | + | |
| 4383 | + | |
| 4384 | + | |
| 4385 | + | |
| 4386 | + | |
| 4387 | + | |
| 4388 | + | |
| 4389 | + | |
| 4390 | + | |
| 4391 | + | |
| 4392 | + | |
| 4393 | + | |
| 4394 | + | |
| 4395 | + | |
| 4396 | + | |
| 4397 | + | |
| 4398 | + | |
| 4399 | + | |
| 4400 | + | |
| 4401 | + | |
| 4402 | + | |
| 4403 | + | |
| 4404 | + | |
| 4405 | + | |
| 4406 | + | |
| 4407 | + | |
| 4408 | + | |
| 4409 | + | |
| 4410 | + | |
| 4411 | + | |
| 4412 | + | |
| 4413 | + | |
| 4414 | + | |
| 4415 | + | |
| 4416 | + | |
| 4417 | + | |
| 4418 | + | |
| 4419 | + | |
| 4420 | + | |
4355 | 4421 | | |
4356 | 4422 | | |
4357 | 4423 | | |
| |||
8278 | 8344 | | |
8279 | 8345 | | |
8280 | 8346 | | |
8281 | | - | |
| 8347 | + | |
8282 | 8348 | | |
8283 | 8349 | | |
8284 | 8350 | | |
| |||
0 commit comments