Skip to content

[fix](doc) rtrim/strleft: small en/zh sync (LENGTH-based RTRIM demo, drop redundant ZH example)#3837

Merged
morningman merged 1 commit into
apache:masterfrom
boluor:fix/string-functions-bidir-sync-batchC
May 30, 2026
Merged

[fix](doc) rtrim/strleft: small en/zh sync (LENGTH-based RTRIM demo, drop redundant ZH example)#3837
morningman merged 1 commit into
apache:masterfrom
boluor:fix/string-functions-bidir-sync-batchC

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented May 28, 2026

Summary

Two small en/zh sync fixes in string functions:

  • rtrim.md (en): backport the LENGTH-based example from ZH that demonstrates RTRIM only strips ASCII space by default (not \t or \n). Useful corner case the EN page was missing. Re-numbered the rest of the examples (3..8 → 4..9) to keep them in order.
  • strleft.md (zh): remove redundant example 9 (utf-8 字符串). Example 7 already demonstrates UTF-8 multi-byte behavior with more realistic input; example 9 was a single shorter case that added no new info and was the only structural diff vs EN.

Verification

SELECT LENGTH('hello world \t\n '), LENGTH(RTRIM('hello world \t\n ')); on Doris 4.1.1 returns (16, 15), matching the documented expected output.

Scope note

The broader bidirectional sync across the rest of the P1 "both-extra" bucket (trim, field, substring, strright, array-count) requires substantial content-level translation work and is deferred — those pages' example sets diverged in non-trivial ways and need per-example review rather than mechanical alignment.

🤖 Generated with Claude Code

…drop redundant ZH example)

rtrim.md en: backport the LENGTH-based example from ZH that demonstrates
  RTRIM only strips ASCII space by default (not \t or \n). Useful corner-
  case the EN page was missing. Verified end-to-end against Doris 4.1.1.
  Re-numbered the rest of the examples (3..8 -> 4..9) to keep them in
  order.

strleft.md zh: remove redundant example 9 ('utf-8 字符串'). Example 7
  already demonstrates UTF-8 multi-byte behavior with more realistic
  input; example 9 was a single shorter case that adds no new info and
  was the only structural diff vs EN.

Note: the broader bidirectional sync across the full P1 'both-extra'
bucket (trim, field, substring, strright, array-count) requires
substantial content-level translation work and is deferred — those
pages' example sets diverged in non-trivial ways and need per-example
review rather than mechanical alignment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@morningman morningman merged commit 014407e into apache:master May 30, 2026
3 checks passed
morningman pushed a commit that referenced this pull request May 30, 2026
…orner-case adds (en+zh) (#3848)

## Summary

Mechanical port of the 4.x fixes in #3833, #3837, #3838, #3839 to
dev/master. Verified against today's master build (selectdb-qa-test
tarball).

**Skipped** (already applied on dev):
- strleft.md ZH dedup (#3837)
- milliseconds-add.md EN BIGINT-range example (#3834 EN-side; the ZH
duplicate-removal piece is in the sibling PR)

## Files (13)

### EN string-functions
- **from-base64.md, instr.md, length.md, locate.md, lpad.md** — backport
corner-case examples (NULL / empty / multi-byte UTF-8 / numeric / etc.)
added in #3833
- **rtrim.md** — add the LENGTH-based 'default-only-strips-ASCII-space'
example (#3837)
- **substring.md** — add the missing 'empty source string' example +
'NULL passed directly' (#3839)
- **trim.md** — replace example 2's prose + expected output
(`trim('ababccaab', 'ab')` is `cca`, not `ababcca` — trim repeatedly
strips from both ends), plus the UTF-8 multi-byte-pattern example
(#3839)

### EN other-functions
- **field.md** — full replace with 4.x post-fix version: adds CREATE
TABLE setup for `baseall` and `class_test` (which the page references
but never created), adds a NULL row to `class_test`, adds DESC and NULLS
FIRST examples that exercise NULL handling (#3789 + #3839 combined)

### ZH
- **field.md** — add the simple `SELECT FIELD(2, 3, 1, 2, 5)` example
(#3839)
- **ltrim.md** — rewrite example 3 with correct expected output; LTRIM
strips ASCII space only, NOT `\t`/`\n`, so the result still contains the
tab/newline. Switched to a LENGTH() comparison for clarity (#3838)
- **substring.md** — add the SUBSTR alias example (#3839)
- **trim.md** — add three examples (no-match returns original; repeated
pattern strips until exhausted; asymmetric removal with multi-char
pattern). Also drop a trailing `;;` typo (#3839)

## Verification

Verified end-to-end against today's master cluster — all added /
modified examples behave identically on master as on 4.1.1, so the doc
fixes apply unchanged.

## Related 4.x PRs
#3833 #3837 #3838 #3839 (and #3789 for the field.md setup blocks).

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

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.

2 participants