Skip to content

[fix](doc) dev: correct four wrong SQL-function examples (trim_in / murmur_hash3_64_v2 / json_extract_bigint / uncompress)#3864

Merged
morningman merged 1 commit into
apache:masterfrom
boluor:fix/dev-function-example-corrections
Jun 2, 2026
Merged

[fix](doc) dev: correct four wrong SQL-function examples (trim_in / murmur_hash3_64_v2 / json_extract_bigint / uncompress)#3864
morningman merged 1 commit into
apache:masterfrom
boluor:fix/dev-function-example-corrections

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented May 30, 2026

Four dev function-reference examples whose documented output or SQL did not match actual behavior. Each verified end-to-end on a live master daily build (doris-0.0.0-2e72603618c); fixes use the real cluster output.

1. EN string-functions/trim-in.md — wrong trim() value

The "Comparison with TRIM function" example showed trim('ababccaab','ab') = ababccaab (unchanged), which is wrong — TRIM strips the ab unit from both ends. (ZH page already correct.)

SELECT trim_in('ababccaab','ab'), trim('ababccaab','ab');
+----------------------------+-------------------------+
| trim_in('ababccaab', 'ab') | trim('ababccaab', 'ab') |
+----------------------------+-------------------------+
| cc                         | cca                     |
+----------------------------+-------------------------+

2. ZH encrypt-digest-functions/murmur-hash3-64-v2.md — result table copied from the non-v2 page

The first example queries murmur_hash3_64_v2(...) but the result table (header and values) was copy-pasted from murmur_hash3_64. Replaced with the v2 output (mirrors the EN page):

select murmur_hash3_64_v2(null), murmur_hash3_64_v2("hello"), murmur_hash3_64_v2("hello","world");
-> NULL | -3758069500696749310 | -662943091231200135

3. ZH json-functions/json-extract-bigint.md — wrong function in first example

Called json_extract_int (which returns NULL for 122222222222223 via int overflow) while the header/expected showed json_extract_bigint. Corrected the call to match the header, the expected value, and the EN page:

SELECT json_extract_bigint('{"id": 122222222222223, "name": "doris"}', '$.id'); -> 122222222222223

4. ZH string-functions/uncompress.md — broken third-example query

Query was uncompress(compress(abc)) (abc unquoted → parser error Unknown column 'abc') while its header/expected showed uncompress('abc')NULL. Corrected to match the header, expected, and EN page:

select uncompress('abc'); -> NULL

Scope: dev only (docs/ + i18n/.../current/). No ja-source changes. (murmur_hash3_64_v2, json_extract_bigint also exist in released versions — backport scope will be mapped separately.)

🤖 Generated with Claude Code

…urmur_hash3_64_v2 / json_extract_bigint / uncompress)

Four dev function-reference examples whose documented output or SQL did not match
actual behavior. Each verified end-to-end on a live master daily build
(doris-0.0.0-2e72603618c); fixes use the real cluster output.

1. EN string-functions/trim-in.md — "Comparison with TRIM function" example
   showed trim('ababccaab','ab') = 'ababccaab' (unchanged), which is wrong;
   TRIM removes the 'ab' unit from both ends. Corrected to 'cca'. (ZH already
   correct.)
       SELECT trim_in('ababccaab','ab'), trim('ababccaab','ab');
       +----------------------------+-------------------------+
       | trim_in('ababccaab', 'ab') | trim('ababccaab', 'ab') |
       +----------------------------+-------------------------+
       | cc                         | cca                     |
       +----------------------------+-------------------------+

2. ZH encrypt-digest-functions/murmur-hash3-64-v2.md — first example's result
   table (header + values) was copy-pasted from the non-v2 murmur_hash3_64 page.
   The query is murmur_hash3_64_v2(...); replaced the table with the v2 output
   (mirrors the EN page):
       select murmur_hash3_64_v2(null), murmur_hash3_64_v2("hello"), murmur_hash3_64_v2("hello","world");
       -> NULL | -3758069500696749310 | -662943091231200135

3. ZH json-functions/json-extract-bigint.md — first example called
   json_extract_int (returns NULL on the 122222222222223 value via int overflow)
   while the header/expected showed json_extract_bigint. Corrected the call to
   json_extract_bigint to match the header, the expected 122222222222223, and EN:
       SELECT json_extract_bigint('{"id": 122222222222223, "name": "doris"}', '$.id'); -> 122222222222223

4. ZH string-functions/uncompress.md — third example query was
   uncompress(compress(abc)) (abc unquoted -> parser error "Unknown column 'abc'")
   while its header/expected showed uncompress('abc') -> NULL. Corrected the query
   to uncompress('abc') to match the header, expected, and EN:
       select uncompress('abc'); -> NULL

Scope: dev only (docs/ + i18n current/). No ja-source changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@morningman morningman merged commit 7a85208 into apache:master Jun 2, 2026
3 checks passed
morningman pushed a commit that referenced this pull request Jun 2, 2026
…3865)

## What

The **v3.x ZH** page for `MURMUR_HASH3_64_V2` had its example result
table copied verbatim from the non-v2 `MURMUR_HASH3_64` page. Although
the `SELECT` calls `murmur_hash3_64_v2(...)`, the rendered table header
showed `murmur_hash3_64(NULL)` / `murmur_hash3_64('hello')` /
`murmur_hash3_64('hello', 'world')` and the values were the **non-v2**
results:

```
| murmur_hash3_64(NULL) | murmur_hash3_64('hello') | murmur_hash3_64('hello', 'world') |
|                  NULL |     -3215607508166160593 |               3583109472027628045 |
```

## Fix

Mirror the already-correct **v4.x ZH** page — correct `..._v2` header
and the actual v2 hash values:

```
| murmur_hash3_64_v2(null) | murmur_hash3_64_v2("hello") | murmur_hash3_64_v2("hello", "world") |
|                     NULL |        -3758069500696749310 |                  -662943091231200135 |
```

## Verified live

Run on a master daily build (`doris-0.0.0-2e72603618c`):

```sql
select murmur_hash3_64_v2(null), murmur_hash3_64_v2("hello"), murmur_hash3_64_v2("hello", "world");
-- NULL | -3758069500696749310 | -662943091231200135
```

`murmur_hash3_64_v2` is a deterministic hash, so the result is
version-independent; v4.x ZH already shows these values.

## Scope

ZH-only — v3.x has no EN `murmur_hash3_64_v2` page. Backport of the ZH
half of #3864 (dev) to v3.x; **v4.x ZH was already correct**, so no v4.x
change is needed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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.

2 participants