Skip to content

[fix](doc) rtrim.md zh: rewrite the tab/newline example so the result table stays single-row#3805

Open
boluor wants to merge 1 commit into
apache:masterfrom
boluor:fix/rtrim-zh-tabnewline-example
Open

[fix](doc) rtrim.md zh: rewrite the tab/newline example so the result table stays single-row#3805
boluor wants to merge 1 commit into
apache:masterfrom
boluor:fix/rtrim-zh-tabnewline-example

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented May 26, 2026

Summary

Doc page (4.x): `scalar-functions/string-functions/rtrim.md` (ZH).

The third example showed:

```sql
SELECT RTRIM('hello world \t\n ');
```

Whose result is the input minus the trailing space — but the embedded `\t\n` is a real tab and newline, so the result block rendered as two visual rows inside the cell and broke the ASCII grid:

```
| hello world
|
```

This rewrites the same teaching point using `LENGTH()` so the cluster returns two integers (16 / 15) on a single line, and adds a one-sentence prose intro that calls out the lesson: RTRIM only strips ASCII spaces, not tabs or newlines.

Verification

Both LENGTH values confirmed on a single-node Apache Doris 4.1.1 cluster.

Test plan

  • Run the rewritten SQL on a 4.1.1 cluster — result matches `16 | 15`.
  • Result-block stays a single-row ASCII grid.
  • No other change.

🤖 Generated with Claude Code

… block stays a single row

The previous example showed `RTRIM('hello world  \t\n ')` whose result
contains an actual newline character. Markdown then renders that
result as two visual lines inside the result cell:

    | hello world
                 |

which breaks the ASCII grid and makes the result hard to read. Rewrite
the same demonstration using LENGTH() so the result is two integers
on a single row, and add a one-sentence intro that calls out the
teaching point ("RTRIM only strips ASCII spaces, not tabs or
newlines"). The original 16-vs-15 numbers come from running on a
single-node Apache Doris 4.1.1 cluster.

Co-Authored-By: Claude Opus 4.7 (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