Repository navigation
Push decimal byte parts aggregates into the integer MSP - #11302
Open
connortsui20 wants to merge 1 commit into
Open
connortsui20 wants to merge 1 commit into
connortsui20 wants to merge 1 commit into
Conversation
Merging this PR will regress 1 benchmark1 warning
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
connortsui20
force-pushed
the
ct/dbp-aggregates
branch
from
November 6, 2026 18:55
316fa5f to
d98aa59
Compare
This branch has not been deployed
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.
Summary
DecimalByteParts has no kernels for
min_max,min,max,is_sorted, orsum, so each of them decodes the whole array into aDecimalArraybefore it aggregates. When there are no lower parts, the MSP already holds the unscaled decimal values, so the integer aggregate over the MSP gives the same answer without the decode. This matters more after CD5, where a narrow MSP becomes an integerWiden. Pushing the aggregate into the MSP then lands inWiden's own aggregate kernels, which run on the narrow child, instead of widening the MSP into a new buffer and then building a decimal from it.Changes
The integer results are relabeled as decimals with
DecimalValue::from(i64)instead ofScalar::cast, because an integer-to-decimal cast multiplies by10^scale, which is wrong for unscaled values. The tests run every case at scale 0 and scale 2 to catch exactly that.sumonly runs on theStat::Sumpath, because only that path sums each batch from zero, and the other paths add to a running total that can overflow at a different point. A null integer sum meansi64overflow, so the kernel declines and the accumulator falls back to the decimal sum. Follow-up: predict overflow from the dtypes and the batch length (likeis_exact_suminWiden), so a batch that is bound to overflow skips the integer pass.Arrays with lower parts always decline, since their values span several parts and the MSP alone doesn't order or sum them. Every test compares the partial and the dispatched result with the same aggregate on the decoded
DecimalArray, including nulls, empty and all-null batches, out-of-precision values, and integer overflow. CodSpeed'sdbp_computesumandmin_maxcases measure the change.