Add bounded unnest + ordered array_agg reproducer benchmark and SLT coverage#22075
Open
kosiew wants to merge 2 commits intoapache:mainfrom
Open
Add bounded unnest + ordered array_agg reproducer benchmark and SLT coverage#22075kosiew wants to merge 2 commits intoapache:mainfrom
unnest + ordered array_agg reproducer benchmark and SLT coverage#22075kosiew wants to merge 2 commits intoapache:mainfrom
Conversation
…lity - Added a new SQL logic test for unnest_array_agg that includes a synthetic bounded repro - Confirms the transformation from 3×4 to 12 expanded rows - Validates regrouping of array_agg(val ORDER BY idx) - Captures the EXPLAIN VERBOSE plan shape with UnnestExec and ordered AggregateExec - Introduced a scalable benchmark for unnest_array_agg with default settings of 2000 rows and 1000 elements - Added environment scale knobs for customization: - UNNEST_ARRAY_AGG_ROWS - UNNEST_ARRAY_AGG_LIST_LEN
Contributor
Author
|
run benchmark sql env:
BENCH_NAME: unnest_array_agg
BENCH_QUERY: 1
UNNEST_ARRAY_AGG_ROWS: 3
UNNEST_ARRAY_AGG_LIST_LEN: 4 |
Contributor
Author
|
show benchmark queue |
|
Hi @kosiew, you asked to view the benchmark queue (#22075 (comment)).
File an issue against this benchmark runner |
Contributor
Author
|
show benchmark queue |
|
Hi @kosiew, you asked to view the benchmark queue (#22075 (comment)). No pending jobs. File an issue against this benchmark runner |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
This PR adds a compact and reproducible test shape for the reported high-memory query pattern involving:
unnestGROUP BYarray_agg(... ORDER BY ...)The goal is to isolate and document the execution shape before optimizer or executor fixes are introduced. The reproducer is intentionally bounded so it can run reliably in local and CI environments while still demonstrating the problematic expansion pattern.
What changes are included in this PR?
Added a new benchmark:
benchmarks/sql_benchmarks/unnest_array_agg/benchmarks/q01.benchmarkAdded SQLLogicTest coverage:
datafusion/sqllogictest/test_files/unnest_array_agg_repro.sltAdded a bounded synthetic workload that:
rangeunnestarray_agg(val ORDER BY idx)Added validation of the intermediate row expansion count.
Captured
EXPLAIN VERBOSEoutput for the reproducer, including:Added configurable benchmark scaling via:
UNNEST_ARRAY_AGG_ROWSUNNEST_ARRAY_AGG_LIST_LENAre these changes tested?
Yes.
This PR adds:
SQLLogicTest coverage in:
datafusion/sqllogictest/test_files/unnest_array_agg_repro.sltA benchmark reproducer in:
benchmarks/sql_benchmarks/unnest_array_agg/benchmarks/q01.benchmarkThe SLT verifies:
array_aggresultsEXPLAIN VERBOSEplan shape includingUnnestExecandAggregateExecAre there any user-facing changes?
No user-facing changes. This PR only adds regression coverage and benchmarking infrastructure for a specific query shape.
LLM-generated code disclosure
This PR includes LLM-generated code and comments. All LLM-generated content has been manually reviewed and tested.