Skip to content

fix(stats): widen sum_value integer arithmetic to SUM-compatible types#20865

Open
kumarUjjawal wants to merge 1 commit intoapache:mainfrom
kumarUjjawal:fix/precision_sum_i64
Open

fix(stats): widen sum_value integer arithmetic to SUM-compatible types#20865
kumarUjjawal wants to merge 1 commit intoapache:mainfrom
kumarUjjawal:fix/precision_sum_i64

Conversation

@kumarUjjawal
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

As discussed in the review thread on #20768 and tracked by #20826, sum_value should not keep narrow integer column types during stats aggregation, because merge/multiply paths can overflow before values are widened.

What changes are included in this PR?

This PR updates statistics sum_value arithmetic to match SUM-style widening for small integer types, and applies that behavior consistently across merge and multiplication paths.

Are these changes tested?

Yes

Are there any user-facing changes?

@github-actions github-actions bot added physical-expr Changes to the physical-expr crates common Related to common crate datasource Changes to the datasource crate physical-plan Changes to the physical-plan crate labels Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to common crate datasource Changes to the datasource crate physical-expr Changes to the physical-expr crates physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Match Precision sum function against Int64 to prevent overflow.

1 participant