Repository navigation
perf(calcite): fold GROUP BY on boolean and integer columns per value - #561
Merged
Merged
Conversation
The reader needs the same primitive long-to-int map for grouped aggregation that the writer uses for dictionary encoding and stats, and the reader cannot depend on the writer. core.compute already holds the kernels both sides share. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WtuVGQ5h5Lk6Zn4JnkxF1K
Only a dictionary-encoded string column grouped in the scan; a GROUP BY on a boolean or integer column built a row per record for Calcite to hash. Compute.groupedAggregate now also groups by a boolean column (two ids) and an integer column other than u64: a first pass assigns group ids through the primitive LongIntMap, a second folds the rows per id, so no key is boxed per row. More than 65,536 distinct values in a chunk declines, and so do more than 10,000 groups in all, as before. The result keys are Object (String, Boolean or Long); the method is unreleased, so the signature changes in place. Raincloud, best of 3, ms: appian-order group by order_isExpeditedShipped 116 -> 32 store_sales group by ss_store_sk, count, sum 154 -> 76 imdb title group by kind_id 93 -> 36 customer where segment = 'BUILDING' group by nation 30 -> 16 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WtuVGQ5h5Lk6Zn4JnkxF1K
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.
Two commits:
LongIntMapmoves fromwriter.encodetocore.compute, so the reader can use it (the reader cannot depend on the writer).Compute.groupedAggregatealso groups by a boolean column and an integer column other thanu64: group ids are assigned throughLongIntMapin a first pass, rows fold per id in a second, no key boxed per row. More than 65,536 values in a chunk (or 10,000 groups in all) falls back to the scan. Keys becomeObject(String/Boolean/Long); the method is unreleased.group by order_isExpeditedShippedgroup by ss_store_sk, count, sumgroup by kind_idwhere segment = 'BUILDING' group by nationTests
ComputeTest: boolean keys with a null group, integer keys with a filter,u64and too-many-values declines.GROUP BYon a Rust-written integer column, with and withoutWHERE, pushed down and equal to the scan.🤖 Generated with Claude Code
https://claude.ai/code/session_01WtuVGQ5h5Lk6Zn4JnkxF1K