Skip to content

[BugFix] Add TYPE_DECIMAL256 support for column aggregators in PRIMARY KEY tables#68134

Merged
andyziye merged 1 commit intoStarRocks:mainfrom
stephen-shelby:fix_decimal256_pk
Jan 21, 2026
Merged

[BugFix] Add TYPE_DECIMAL256 support for column aggregators in PRIMARY KEY tables#68134
andyziye merged 1 commit intoStarRocks:mainfrom
stephen-shelby:fix_decimal256_pk

Conversation

@stephen-shelby
Copy link
Contributor

@stephen-shelby stephen-shelby commented Jan 20, 2026

Why I'm doing:

When using DECIMAL columns with precision > 38 (e.g., DECIMAL(39,0)) in PRIMARY KEY tables, the backend crashes during data insertion:

Check failed: false unreachable path, unknown key column type: 26

The column aggregator factory doesn't support TYPE_DECIMAL256 (type ID 26), which is required for decimal precision between 39-76.

What I'm doing:

Backend fix (be/src/storage/column_aggregate_func.cpp):

  • Add TYPE_DECIMAL256 support for REPLACE aggregation (line 380)
  • Add TYPE_DECIMAL256 support for key column aggregation (line 427)

Fixes #67991

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
    • This pr needs auto generate documentation
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.1
    • 4.0
    • 3.5
    • 3.4

…Y KEY tables

Signed-off-by: stephen <stephen5217@163.com>
@StarRocks-Reviewer
Copy link

@cursor review

@stephen-shelby stephen-shelby changed the title [BugFix] Add TYPE_DECIMAL256 support for column aggregators in PRIMARY KEY tables [UT] Add TYPE_DECIMAL256 support for column aggregators in PRIMARY KEY tables Jan 20, 2026
@stephen-shelby stephen-shelby changed the title [UT] Add TYPE_DECIMAL256 support for column aggregators in PRIMARY KEY tables [BugFix] Add TYPE_DECIMAL256 support for column aggregators in PRIMARY KEY tables Jan 20, 2026
@github-actions
Copy link
Contributor

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link
Contributor

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link
Contributor

[BE Incremental Coverage Report]

fail : 0 / 2 (00.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/storage/column_aggregate_func.cpp 0 2 00.00% [380, 427]

@andyziye andyziye merged commit 79fff5c into StarRocks:main Jan 21, 2026
115 of 133 checks passed
@github-actions
Copy link
Contributor

@Mergifyio backport branch-4.0

@github-actions
Copy link
Contributor

@Mergifyio backport branch-4.1

@mergify
Copy link
Contributor

mergify bot commented Jan 21, 2026

backport branch-4.0

✅ Backports have been created

Details

@mergify
Copy link
Contributor

mergify bot commented Jan 21, 2026

backport branch-4.1

✅ Backports have been created

Details

mergify bot pushed a commit that referenced this pull request Jan 21, 2026
…Y KEY tables (#68134)

Signed-off-by: stephen <stephen5217@163.com>
(cherry picked from commit 79fff5c)
mergify bot pushed a commit that referenced this pull request Jan 21, 2026
…Y KEY tables (#68134)

Signed-off-by: stephen <stephen5217@163.com>
(cherry picked from commit 79fff5c)
wanpengfei-git pushed a commit that referenced this pull request Jan 21, 2026
…Y KEY tables (backport #68134) (#68193)

Signed-off-by: stephen <stephen5217@163.com>
Co-authored-by: stephen <91597003+stephen-shelby@users.noreply.github.com>
wanpengfei-git pushed a commit that referenced this pull request Jan 21, 2026
…Y KEY tables (backport #68134) (#68192)

Signed-off-by: stephen <stephen5217@163.com>
Co-authored-by: stephen <91597003+stephen-shelby@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Segmentation fault on INSERT INTO VALUES with DECIMAL (39,0)

5 participants