Skip to content

[fix](doc) v4.x: correct wrong expected outputs in five string-function examples#3860

Open
boluor wants to merge 1 commit into
apache:masterfrom
boluor:fix/string-func-wrong-expected-4.x
Open

[fix](doc) v4.x: correct wrong expected outputs in five string-function examples#3860
boluor wants to merge 1 commit into
apache:masterfrom
boluor:fix/string-func-wrong-expected-4.x

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented May 30, 2026

Background

A native both-language re-check — examples that fail identically in EN and ZH, so a cross-language diff never surfaces them — found five string-function pages whose documented example result does not match the server. All are deterministic and verified on a fresh Doris 4.1.1 cluster. Each is wrong in both EN and ZH.

Bugs fixed

Page Documented Correct (cluster) Why
ends-with.md ENDS_WITH('testing','test') = 1 0 "testing" does not end with "test"
reverse.md irànnaumuḍḍ irànnamuḍḍ spurious extra u; actual reverse of ḍḍumannàri
mask-last-n.md Hello你好nnn (header Hello你好123) Helloṭṛnnn result block was for a different input than the example SQL mask_last_n('Helloṭṛ123', 9)
position.md 13 12 'hello' starts at character position 12 of 'ṭṛì ḍḍumai hello'
mask.md Xxxx999 Axxx999 the example demonstrates a custom upper-case replacement 'ABC', so T → A, not the default X

Cluster verification (Doris 4.1.1)

ENDS_WITH('test','test'), ENDS_WITH('testing','test')   -> 1 , 0
REVERSE('ṭṛì ḍḍumai'), REVERSE('ḍḍumannàri')            -> iamuḍḍ ìṛṭ , irànnamuḍḍ
mask_last_n('Helloṭṛ123', 9)                            -> Helloṭṛnnn
POSITION('ḍḍumai' IN 'ṭṛì ḍḍumai hello'),
    POSITION('hello','ṭṛì ḍḍumai hello',8)              -> 5 , 12
mask('Test123','ABC','xyz','999')                       -> Axxx999

The same fixes apply to dev (identical wrong values); a follow-up backport PR will cover dev after verification on a master build.

🤖 Generated with Claude Code

…on examples

A native both-language re-check (examples that fail identically in EN and ZH,
so a cross-language diff never surfaces them) found five string-function pages
whose documented example result does not match what the server returns. All
are deterministic and were verified on a fresh Doris 4.1.1 cluster:

1. ends-with.md — ENDS_WITH('testing', 'test') is documented as 1, but
   "testing" does not end with "test" → 0.
2. reverse.md — REVERSE('ḍḍumannàri') documented as 'irànnaumuḍḍ' (an extra
   'u'); the actual reverse is 'irànnamuḍḍ'.
3. mask-last-n.md — the result block was for a different input
   ('Hello你好123' → 'Hello你好nnn'); the example SQL is mask_last_n('Helloṭṛ123', 9),
   which returns 'Helloṭṛnnn'. Header + value replaced with real output.
4. position.md — POSITION('hello', 'ṭṛì ḍḍumai hello', 8) documented as 13;
   'hello' starts at character position 12.
5. mask.md — mask('Test123', 'ABC', 'xyz', '999') documented as 'Xxxx999',
   which ignores the custom upper-case replacement the example is meant to
   demonstrate; the actual result is 'Axxx999' ('T' → 'A' from 'ABC').

Each fix is applied to both EN and ZH (both carried the same wrong value).

Cluster verification (Doris 4.1.1):

    ENDS_WITH('test','test'), ENDS_WITH('testing','test')        -> 1 , 0
    REVERSE('ṭṛì ḍḍumai'), REVERSE('ḍḍumannàri')                 -> iamuḍḍ ìṛṭ , irànnamuḍḍ
    mask_last_n('Helloṭṛ123', 9)                                 -> Helloṭṛnnn
    POSITION('ḍḍumai' IN 'ṭṛì ḍḍumai hello'),
        POSITION('hello','ṭṛì ḍḍumai hello',8)                   -> 5 , 12
    mask('Test123','ABC','xyz','999')                            -> Axxx999

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant