Skip to content

fix: allow group_concat fields above 64 KiB - #28702

Merged
XuPeng-SH merged 12 commits into
matrixorigin:mainfrom
aunjgr:fix/group-concat-large-field-28653
Sep 12, 2026
Merged

XuPeng-SH merged 12 commits into
matrixorigin:mainfrom
aunjgr:fix/group-concat-large-field-28653

Conversation

@aunjgr

@aunjgr aunjgr commented Sep 11, 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 #28653

What this PR does / why we need it:

GROUP_CONCAT rejected individual text, binary, and JSON fields larger than 65,535 bytes, although its length-delimited payload and spill format already use uint32 field lengths. Valid large values therefore failed independently of group_concat_max_len.

Remove the obsolete 16-bit field limit from text, binary, JSON, and vector output formatting. Keep the existing uint32 payload encoder, spill format, and JSON aggregate APIs unchanged; the fix does not introduce a new generic encoding protocol.

Keep group_concat_max_len as the output limit and retain existing spill and allocation ownership. Cover the 65,535/65,536-byte boundary, 70,000-byte values, the 65,536-byte vector boundary, JSON's formatted representation, and exact recovery through ordered spill.

Preserve the original shuffle abort cause when a sibling reaches Prepare after pool retirement. Cancellation from an early-finished consumer must remain distinguishable from a substantive execution error; retain the existing admission and cleanup safeguards.

Remove the obsolete uint16 field limit while preserving the uint32 payload contract, allocation accounting, and bounded spill behavior.
@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 →

Correct the JSON length expectations to include the space after the object separator. Preserve independent TEXT/BLOB size checks at and above the former 64-KiB boundary.
@mergify mergify Bot added the queued label Sep 12, 2026
@mergify

mergify Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-12 14:50 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-09-12 14:54 UTC · at d6ef8c01da65aa6c7c7499e7c669741388275730

This pull request spent 3 minutes 50 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 #28702 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

@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.

Follow-up verification note: after my review, the branch advanced from 8c5983df9c716a9c091e33d1dab711399bb8534d to d6ef8c01da65aa6c7c7499e7c669741388275730 by merging latest main. The current PR diff is still the same nine GROUP_CONCAT/shuffle files reviewed above; the newly triggered CI for d6ef8c0 is now in progress, so the prior green CI was for the pre-merge head, not this exact head. I am not waiting for the rerun.

@XuPeng-SH
XuPeng-SH merged commit e4f00c8 into matrixorigin:main Sep 12, 2026
18 of 20 checks passed
@mergify mergify Bot added dequeued and removed queued labels Sep 12, 2026
XuPeng-SH added a commit that referenced this pull request Sep 13, 2026
…8801)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Related to #28653, #28249, and #28250. This PR only changes regression
tests; it does not itself fix or close these issues. The GROUP_CONCAT
production fix was merged in #28702, and the user-level lock behavior
fix was merged in #28783.

## What this PR does / why we need it:

This test-only follow-up consolidates related SQL-function coverage
while preserving distinct test oracles:

- Keeps the existing 70,000-byte text case and adds exact-output JSON
and float32-vector cases through the real GROUP_CONCAT ordered-spill
path. JSON and vector rendered outputs are each 65,536 bytes. The test
asserts spill occurred before flush, checks complete output bytes, and
verifies memory-pool cleanup.
- Moves the three unique free-lock timeout-type probes (DOUBLE `0`,
DECIMAL `0.5`, and DOUBLE `0.5`) into the broader `user_lock.sql` case,
then removes the duplicate `func_user_lock.test/.result`. Existing lock
lifecycle, contention, NULL-name, NULL-timeout, and case-insensitive
checks remain. The precise DECIMAL-vs-DOUBLE rounding behavior remains
owned by `TestGetLockDecimalTimeoutUsesDecimalRounding`.
- Removes one adjacent, identical basic GROUP_CONCAT SELECT and its
duplicate expected-output block. The first assertion remains; this was
not a controlled cache/reuse test, and no measured runtime improvement
is claimed.

No production code or behavior changes.

## Test Plan

- [x] Focused CGo UTs: `TestGroupConcatLargeValuesAcrossOrderedSpill`,
`TestAppendGroupConcatDataCoversTypes`, and
`TestGroupConcatVectorValuesAcrossFinalizers` — PASS.
- [x] Full `./pkg/sql/colexec/aggexec` test package — PASS (1.346s).
- [x] `go vet -mod=readonly ./pkg/sql/colexec/aggexec` with
repository-matched CGo flags — PASS.
- [x] Incremental `golangci-lint` for `./pkg/sql/colexec/aggexec`
against the PR base — 0 issues.
- [x] On 55, using a service built from current main
`68860942354a7deb58158197e1e458d6094ec1bd` in an isolated network
namespace, ran each modified BVT twice with mo-tester:
  - `user_lock.sql`: 67/67 passed on both runs.
  - `function_group_concat.sql`: 228/228 passed on both runs.
- [x] `gofmt` and `git diff --check` — PASS.

QA can run the two BVT cases with `./run.sh -n -g -p <path-to-case.sql>`
against a test-owned MatrixOne instance. Both cases clean up their
database/table state and were rerun successfully on the same isolated
instance. CI was not awaited for this update.
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#28653

## What this PR does / why we need it:

GROUP_CONCAT rejected individual text, binary, and JSON fields larger
than 65,535 bytes, although its length-delimited payload and spill
format already use uint32 field lengths. Valid large values therefore
failed independently of group_concat_max_len.

Remove the obsolete 16-bit field limit from text, binary, JSON, and
vector output formatting. Keep the existing uint32 payload encoder,
spill format, and JSON aggregate APIs unchanged; the fix does not
introduce a new generic encoding protocol.

Keep group_concat_max_len as the output limit and retain existing spill
and allocation ownership. Cover the 65,535/65,536-byte boundary,
70,000-byte values, the 65,536-byte vector boundary, JSON's formatted
representation, and exact recovery through ordered spill.

Preserve the original shuffle abort cause when a sibling reaches Prepare
after pool retirement. Cancellation from an early-finished consumer must
remain distinguishable from a substantive execution error; retain the
existing admission and cleanup safeguards.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…trixorigin#28801)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Related to matrixorigin#28653, matrixorigin#28249, and matrixorigin#28250. This PR only changes regression
tests; it does not itself fix or close these issues. The GROUP_CONCAT
production fix was merged in matrixorigin#28702, and the user-level lock behavior
fix was merged in matrixorigin#28783.

## What this PR does / why we need it:

This test-only follow-up consolidates related SQL-function coverage
while preserving distinct test oracles:

- Keeps the existing 70,000-byte text case and adds exact-output JSON
and float32-vector cases through the real GROUP_CONCAT ordered-spill
path. JSON and vector rendered outputs are each 65,536 bytes. The test
asserts spill occurred before flush, checks complete output bytes, and
verifies memory-pool cleanup.
- Moves the three unique free-lock timeout-type probes (DOUBLE `0`,
DECIMAL `0.5`, and DOUBLE `0.5`) into the broader `user_lock.sql` case,
then removes the duplicate `func_user_lock.test/.result`. Existing lock
lifecycle, contention, NULL-name, NULL-timeout, and case-insensitive
checks remain. The precise DECIMAL-vs-DOUBLE rounding behavior remains
owned by `TestGetLockDecimalTimeoutUsesDecimalRounding`.
- Removes one adjacent, identical basic GROUP_CONCAT SELECT and its
duplicate expected-output block. The first assertion remains; this was
not a controlled cache/reuse test, and no measured runtime improvement
is claimed.

No production code or behavior changes.

## Test Plan

- [x] Focused CGo UTs: `TestGroupConcatLargeValuesAcrossOrderedSpill`,
`TestAppendGroupConcatDataCoversTypes`, and
`TestGroupConcatVectorValuesAcrossFinalizers` — PASS.
- [x] Full `./pkg/sql/colexec/aggexec` test package — PASS (1.346s).
- [x] `go vet -mod=readonly ./pkg/sql/colexec/aggexec` with
repository-matched CGo flags — PASS.
- [x] Incremental `golangci-lint` for `./pkg/sql/colexec/aggexec`
against the PR base — 0 issues.
- [x] On 55, using a service built from current main
`68860942354a7deb58158197e1e458d6094ec1bd` in an isolated network
namespace, ran each modified BVT twice with mo-tester:
  - `user_lock.sql`: 67/67 passed on both runs.
  - `function_group_concat.sql`: 228/228 passed on both runs.
- [x] `gofmt` and `git diff --check` — PASS.

QA can run the two BVT cases with `./run.sh -n -g -p <path-to-case.sql>`
against a test-owned MatrixOne instance. Both cases clean up their
database/table state and were rerun successfully on the same isolated
instance. CI was not awaited for this update.
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#28653

## What this PR does / why we need it:

GROUP_CONCAT rejected individual text, binary, and JSON fields larger
than 65,535 bytes, although its length-delimited payload and spill
format already use uint32 field lengths. Valid large values therefore
failed independently of group_concat_max_len.

Remove the obsolete 16-bit field limit from text, binary, JSON, and
vector output formatting. Keep the existing uint32 payload encoder,
spill format, and JSON aggregate APIs unchanged; the fix does not
introduce a new generic encoding protocol.

Keep group_concat_max_len as the output limit and retain existing spill
and allocation ownership. Cover the 65,535/65,536-byte boundary,
70,000-byte values, the 65,536-byte vector boundary, JSON's formatted
representation, and exact recovery through ordered spill.

Preserve the original shuffle abort cause when a sibling reaches Prepare
after pool retirement. Cancellation from an early-finished consumer must
remain distinguishable from a substantive execution error; retain the
existing admission and cleanup safeguards.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…trixorigin#28801)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Related to matrixorigin#28653, matrixorigin#28249, and matrixorigin#28250. This PR only changes regression
tests; it does not itself fix or close these issues. The GROUP_CONCAT
production fix was merged in matrixorigin#28702, and the user-level lock behavior
fix was merged in matrixorigin#28783.

## What this PR does / why we need it:

This test-only follow-up consolidates related SQL-function coverage
while preserving distinct test oracles:

- Keeps the existing 70,000-byte text case and adds exact-output JSON
and float32-vector cases through the real GROUP_CONCAT ordered-spill
path. JSON and vector rendered outputs are each 65,536 bytes. The test
asserts spill occurred before flush, checks complete output bytes, and
verifies memory-pool cleanup.
- Moves the three unique free-lock timeout-type probes (DOUBLE `0`,
DECIMAL `0.5`, and DOUBLE `0.5`) into the broader `user_lock.sql` case,
then removes the duplicate `func_user_lock.test/.result`. Existing lock
lifecycle, contention, NULL-name, NULL-timeout, and case-insensitive
checks remain. The precise DECIMAL-vs-DOUBLE rounding behavior remains
owned by `TestGetLockDecimalTimeoutUsesDecimalRounding`.
- Removes one adjacent, identical basic GROUP_CONCAT SELECT and its
duplicate expected-output block. The first assertion remains; this was
not a controlled cache/reuse test, and no measured runtime improvement
is claimed.

No production code or behavior changes.

## Test Plan

- [x] Focused CGo UTs: `TestGroupConcatLargeValuesAcrossOrderedSpill`,
`TestAppendGroupConcatDataCoversTypes`, and
`TestGroupConcatVectorValuesAcrossFinalizers` — PASS.
- [x] Full `./pkg/sql/colexec/aggexec` test package — PASS (1.346s).
- [x] `go vet -mod=readonly ./pkg/sql/colexec/aggexec` with
repository-matched CGo flags — PASS.
- [x] Incremental `golangci-lint` for `./pkg/sql/colexec/aggexec`
against the PR base — 0 issues.
- [x] On 55, using a service built from current main
`68860942354a7deb58158197e1e458d6094ec1bd` in an isolated network
namespace, ran each modified BVT twice with mo-tester:
  - `user_lock.sql`: 67/67 passed on both runs.
  - `function_group_concat.sql`: 228/228 passed on both runs.
- [x] `gofmt` and `git diff --check` — PASS.

QA can run the two BVT cases with `./run.sh -n -g -p <path-to-case.sql>`
against a test-owned MatrixOne instance. Both cases clean up their
database/table state and were rerun successfully on the same isolated
instance. CI was not awaited for this update.
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#28653

## What this PR does / why we need it:

GROUP_CONCAT rejected individual text, binary, and JSON fields larger
than 65,535 bytes, although its length-delimited payload and spill
format already use uint32 field lengths. Valid large values therefore
failed independently of group_concat_max_len.

Remove the obsolete 16-bit field limit from text, binary, JSON, and
vector output formatting. Keep the existing uint32 payload encoder,
spill format, and JSON aggregate APIs unchanged; the fix does not
introduce a new generic encoding protocol.

Keep group_concat_max_len as the output limit and retain existing spill
and allocation ownership. Cover the 65,535/65,536-byte boundary,
70,000-byte values, the 65,536-byte vector boundary, JSON's formatted
representation, and exact recovery through ordered spill.

Preserve the original shuffle abort cause when a sibling reaches Prepare
after pool retirement. Cancellation from an early-finished consumer must
remain distinguishable from a substantive execution error; retain the
existing admission and cleanup safeguards.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…trixorigin#28801)

## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Related to matrixorigin#28653, matrixorigin#28249, and matrixorigin#28250. This PR only changes regression
tests; it does not itself fix or close these issues. The GROUP_CONCAT
production fix was merged in matrixorigin#28702, and the user-level lock behavior
fix was merged in matrixorigin#28783.

## What this PR does / why we need it:

This test-only follow-up consolidates related SQL-function coverage
while preserving distinct test oracles:

- Keeps the existing 70,000-byte text case and adds exact-output JSON
and float32-vector cases through the real GROUP_CONCAT ordered-spill
path. JSON and vector rendered outputs are each 65,536 bytes. The test
asserts spill occurred before flush, checks complete output bytes, and
verifies memory-pool cleanup.
- Moves the three unique free-lock timeout-type probes (DOUBLE `0`,
DECIMAL `0.5`, and DOUBLE `0.5`) into the broader `user_lock.sql` case,
then removes the duplicate `func_user_lock.test/.result`. Existing lock
lifecycle, contention, NULL-name, NULL-timeout, and case-insensitive
checks remain. The precise DECIMAL-vs-DOUBLE rounding behavior remains
owned by `TestGetLockDecimalTimeoutUsesDecimalRounding`.
- Removes one adjacent, identical basic GROUP_CONCAT SELECT and its
duplicate expected-output block. The first assertion remains; this was
not a controlled cache/reuse test, and no measured runtime improvement
is claimed.

No production code or behavior changes.

## Test Plan

- [x] Focused CGo UTs: `TestGroupConcatLargeValuesAcrossOrderedSpill`,
`TestAppendGroupConcatDataCoversTypes`, and
`TestGroupConcatVectorValuesAcrossFinalizers` — PASS.
- [x] Full `./pkg/sql/colexec/aggexec` test package — PASS (1.346s).
- [x] `go vet -mod=readonly ./pkg/sql/colexec/aggexec` with
repository-matched CGo flags — PASS.
- [x] Incremental `golangci-lint` for `./pkg/sql/colexec/aggexec`
against the PR base — 0 issues.
- [x] On 55, using a service built from current main
`68860942354a7deb58158197e1e458d6094ec1bd` in an isolated network
namespace, ran each modified BVT twice with mo-tester:
  - `user_lock.sql`: 67/67 passed on both runs.
  - `function_group_concat.sql`: 228/228 passed on both runs.
- [x] `gofmt` and `git diff --check` — PASS.

QA can run the two BVT cases with `./run.sh -n -g -p <path-to-case.sql>`
against a test-owned MatrixOne instance. Both cases clean up their
database/table state and were rerun successfully on the same isolated
instance. CI was not awaited for this update.

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