Optimize collect_list for fixed-width and varchar types - #731
Open
taiyang-li wants to merge 6 commits into
Open
Conversation
taiyang-li
force-pushed
the
collect-list-top1-typed-oss
branch
from
July 12, 2026 06:58
b26fd5b to
b05c2e0
Compare
taiyang-li
marked this pull request as ready for review
July 12, 2026 08:27
taiyang-li
requested review from
HaoChen-ch,
WangGuangxin,
wangxinshuo-bolt,
zhangxffff and
zjuwangg
July 13, 2026 03:08
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.
What problem does this PR solve?
Issue Number: close #xxx
Type of Change
Description
This PR optimizes Spark-compatible
collect_listaggregation in two paths.For fixed-width primitive inputs, such as
BIGINT,INT,DOUBLE, etc.,collect_listnow uses a typed accumulator backed by contiguous typed storage instead of the genericValueList + ContainerRowSerdepath. This avoids per-value generic row serialization/deserialization and reduces accumulator overhead for fixed-width values.For
VARCHAR/VARBINARYinputs, this PR keeps the existingValueListaccumulator layout, but adds a string-specific fast path for appending and reading string values. The serialized layout remainslength + bytes, while avoiding the broaderContainerRowSerdedispatch path for string collect_list accumulation and extraction.Together, these changes improve both fixed-width and string
collect_listworkloads, including Spark-stylepartial aggregation -> final aggregationplans.Performance Impact
Benchmark target:
Before:
After:
Summary:
collect_list_bigint_partial_final_plan18.83ms3.51ms5.36xcollect_list_string_partial_final_plan26.87ms12.09ms2.22xThis shows a significant improvement for both primitive and string
collect_listin a plan shape that includes both partial and final aggregation.Checklist (For Author)
Breaking Changes
No
Yes (Description: ...)
Click to view Breaking Changes