Skip to content

fix: support decimal256 indexes and normalize spill errors - #28845

Merged
XuPeng-SH merged 7 commits into
matrixorigin:mainfrom
aptend:fix/28586-decimal256-index
Sep 17, 2026
Merged

XuPeng-SH merged 7 commits into
matrixorigin:mainfrom
aptend:fix/28586-decimal256-index

Conversation

@aptend

@aptend aptend commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #28586
issue #27627

What this PR does / why we need it:

  • Add DECIMAL256 support to the serial/serial_full encoders and the batch index-key serializer used by ordinary secondary indexes.
  • Normalize spill resource-admission failures from MergeOrder, Group, Top, and Fill at their public execution boundaries into client-facing resource-exhausted errors, while preserving lifecycle and allocator errors.
  • Keep the focused unit coverage orthogonal by asserting both the public error contract and spill-resource cleanup on the existing admission tests.

Validation:

  • make build
  • GOWORK=off go test -mod=readonly -count=1 -timeout=15m ./pkg/sql/colexec/hashbuild ./pkg/sql/colexec/mergeorder ./pkg/sql/colexec/group ./pkg/sql/colexec/top ./pkg/sql/colexec/fill
  • GOWORK=off go test -mod=readonly -count=1 -timeout=15m ./pkg/sql/plan/function
  • GOWORK=off go test -mod=readonly -count=1 -timeout=15m ./pkg/sql/util
  • GOWORK=off go vet -mod=readonly ./pkg/sql/colexec/hashbuild ./pkg/sql/colexec/mergeorder ./pkg/sql/colexec/group ./pkg/sql/colexec/top ./pkg/sql/colexec/fill ./pkg/sql/plan/function ./pkg/sql/util
  • mo-tester -c -p /home/mo/matrixone/test/distributed/cases/dtype/decimal_256.test
  • standalone SQL verification of populated ordinary secondary-index creation and subsequent Decimal256 insert

Note: SERIAL_EXTRACT Decimal256 support is not included; it is a separate known limitation.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify mergify Bot added the kind/bug Something isn't working label Sep 14, 2026
@matrix-meow matrix-meow added the size/S Denotes a PR that changes [10,99] lines label Sep 14, 2026
@aptend aptend changed the title fix: support decimal256 index key serialization fix: support decimal256 indexes and normalize spill errors Sep 14, 2026
@matrix-meow matrix-meow added size/M Denotes a PR that changes [100,499] lines and removed size/S Denotes a PR that changes [10,99] lines labels Sep 14, 2026
@aptend
aptend requested a review from XuPeng-SH September 15, 2026 06:46

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GPT-6 medium deep review at exact head c23419a.

The two prior blockers are closed:

  • Decimal256 is now encoded by serialWithCompacted and compactSingleIndexCol/compactPrimaryCol, so composite unique-index writers and LOAD DATA use the same Decimal256 key representation, including null-row compaction.
  • Decimal256 is now supported by the serial contract, component encoder, SerialHelper, and serial_extract, so covering reads through a Decimal256 secondary index no longer hit the previous unsupported-type path.

I reviewed all 18 changed files. The new tests cover encoder and size-bound contracts, null handling, composite unique-key construction, ordinary-index covering reads, LOAD DATA into a composite unique index, and the changed terminal spill-resource error contract. The operator-boundary conversion is applied to Fill, Group, MergeOrder, and Top while preserving lifecycle/invalid-resource errors and retaining the existing HashBuild-specific guidance.

Required CI is green, including Ubuntu UT/race, SCA, coverage, shared build, compose/standalone BVT, and CI Required. The PR is mergeable without conflict and only behind the base branch.

No evidence-backed P0/P1/P2 blocker remains. Approving this exact head.

@mergify

mergify Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-17 03:11 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-09-17 03:18 UTC · at c3f74930b11edab17cd0f8af6d53f79fe687ce8d

This pull request spent 7 minutes 27 seconds in the queue, with no time running CI.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Reason

Pull request #28845 has been dequeued

Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants