[fix](doc) v2.1/v3.x: correct ARRAY_ENUMERATE_UNIQ multi-array example result#3859
Open
boluor wants to merge 1 commit into
Open
[fix](doc) v2.1/v3.x: correct ARRAY_ENUMERATE_UNIQ multi-array example result#3859boluor wants to merge 1 commit into
boluor wants to merge 1 commit into
Conversation
…e result The multi-array example select array_enumerate_uniq([1,1,1,1,1],[2,1,2,1,2],[3,1,3,1,3]); is documented as [1, 1, 2, 1, 3], which is wrong. array_enumerate_uniq returns, for each position, the ordinal of that position's tuple among equal tuples. The by-position tuples here are: (1,2,3) (1,1,1) (1,2,3) (1,1,1) (1,2,3) so the ordinals are [1, 1, 2, 2, 3] (the 4th position is the 2nd occurrence of (1,1,1), not the 1st). The doc had 1 at the 4th position. Present (and fixed) in: v2.1 EN, v3.x EN, v3.x ZH. Already correct in v2.1 ZH, v4.x and dev, so they are untouched. This page's other examples are correct (verified by hand and on cluster): - single array [1,2,3,1,2,3] -> [1,1,1,2,2,2] - description prose [1,2,1,1,2],[2,1,2,2,1] -> [1,1,2,3,2] Cluster verification (Doris 3.1.4-rc02 and 2.1.11-rc01, both identical): mysql> select array_enumerate_uniq([1, 1, 1, 1, 1], [2, 1, 2, 1, 2], [3, 1, 3, 1, 3]); +-------------------------------------------------------------------------+ | array_enumerate_uniq([1, 1, 1, 1, 1], [2, 1, 2, 1, 2], [3, 1, 3, 1, 3]) | +-------------------------------------------------------------------------+ | [1, 1, 2, 2, 3] | +-------------------------------------------------------------------------+ Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The multi-array example
is documented as
[1, 1, 2, 1, 3], which is wrong.array_enumerate_uniqreturns, for each position, the ordinal of that position's tuple among equal tuples. The by-position tuples here are:so the ordinals are
[1, 1, 2, 2, 3]— the 4th position is the 2nd occurrence of(1,1,1), not the 1st. The doc had1at the 4th position.Scope
Present (and fixed) in v2.1 EN, v3.x EN, v3.x ZH. Already correct in v2.1 ZH, v4.x, and dev, so those are untouched.
This page's other examples are correct (checked by hand and on cluster): the single-array example
[1,2,3,1,2,3] → [1,1,1,2,2,2]and the description prose[1,2,1,1,2],[2,1,2,2,1] → [1,1,2,3,2].Cluster verification (Doris 3.1.4-rc02 and 2.1.11-rc01, identical)
🤖 Generated with Claude Code