Skip to content

[doc](function) Update array_shuffle seed rules - #4176

Merged
yiguolei merged 1 commit into
apache:masterfrom
csun5285:doc/array-shuffle-constant-seed
Oct 9, 2026
Merged

yiguolei merged 1 commit into
apache:masterfrom
csun5285:doc/array-shuffle-constant-seed

Conversation

@csun5285

Copy link
Copy Markdown
Contributor

Update ARRAY_SHUFFLE docs, for apache/doris#68438:

  • seed must be a constant; a column or another non-constant seed reports an error
  • all 64 bits of the seed are used, so any BIGINT works, a negative one too
  • each row is shuffled on its own, a constant array too, and each batch starts a random sequence from the seed

Versions

  • dev
  • 4.x
  • 3.x
  • 2.1 or older (not covered by version/language sync gate)

Languages

  • Chinese
  • English

Docs Checklist

  • Checked by AI
  • Test Cases Built
  • Updated required version and language counterparts, or explained why not
  • If only one language changed, confirmed whether source/translation counterparts need sync

Update the dev and 4.x ARRAY_SHUFFLE docs, in English and Chinese, for
apache/doris#68438:

- seed must be a constant; a column or another non-constant seed reports an error
- all 64 bits of the seed are used, so any BIGINT works, a negative one too
- each row is shuffled on its own, a constant array too, and each batch starts a
  random sequence from the seed
- the 4.x docs note how 4.0 and 4.1 behave

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@yiguolei
yiguolei merged commit 39a6535 into apache:master Oct 9, 2026
3 checks passed
csun5285 added a commit to apache/doris that referenced this pull request Oct 9, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: #44901

Problem Summary:

1. `array_shuffle` now rejects a non-constant seed, which was silently
ignored for every row but the first one of each block.
2. The seed now uses all 64 bits (`std::mt19937_64`), so any BIGINT seed
works, including a negative one, which failed with an out-of-range error
since #44901.
3. Every row is now shuffled on its own, so a constant array no longer
gets the same order on every row, and blocks without a seed no longer
repeat each other.

doc: apache/doris-website#4176

### Release note

`array_shuffle` / `shuffle` rejects a non-constant seed, uses all 64
bits of the seed (so the order for a given seed changes), and shuffles
every row on its own.


### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [x] Regression test
    - [x] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [x] Yes. See the three points above.

- Does this need documentation?
    - [ ] No.
    - [x] Yes. <!-- apache/doris-website PR link to be added -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
github-actions Bot pushed a commit to apache/doris that referenced this pull request Oct 9, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: #44901

Problem Summary:

1. `array_shuffle` now rejects a non-constant seed, which was silently
ignored for every row but the first one of each block.
2. The seed now uses all 64 bits (`std::mt19937_64`), so any BIGINT seed
works, including a negative one, which failed with an out-of-range error
since #44901.
3. Every row is now shuffled on its own, so a constant array no longer
gets the same order on every row, and blocks without a seed no longer
repeat each other.

doc: apache/doris-website#4176

### Release note

`array_shuffle` / `shuffle` rejects a non-constant seed, uses all 64
bits of the seed (so the order for a given seed changes), and shuffles
every row on its own.


### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [x] Regression test
    - [x] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [x] Yes. See the three points above.

- Does this need documentation?
    - [ ] No.
    - [x] Yes. <!-- apache/doris-website PR link to be added -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

This branch was previously deployed

1 inactive deployment
Production — e976ef9e Deployed Sep 28, 2026 by csun5285 via Build Check #8430
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants