Skip to content

[fix](doc) string-functions en: backport corner-case examples that exist on zh (6 pages)#3815

Open
boluor wants to merge 1 commit into
apache:masterfrom
boluor:fix/string-functions-en-backport-zh-examples
Open

[fix](doc) string-functions en: backport corner-case examples that exist on zh (6 pages)#3815
boluor wants to merge 1 commit into
apache:masterfrom
boluor:fix/string-functions-en-backport-zh-examples

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented May 26, 2026

Summary

For six string-functions doc pages, the EN side has fewer examples than the ZH side. This PR ports the ZH-only corner-case examples to EN so both pages cover the same set of behaviors.

Page Examples added to EN Notes
`hex.md` +4 whitespace bytes, UTF-8 input, negative two's complement, mixed alphanum
`initcap.md` +6 empty, non-alphanumeric separators, UTF-8 words, names, sentences, multi-space & adjacent punctuation
`lcase.md` +4 empty, already-lowercase/numeric, non-alphabetic passthrough, UTF-8 case folding
`ltrim.md` +6 empty inputs, multi-char substring strip, full match, UTF-8 substring strip, numeric, punctuation
`replace.md` +4 empty-string edge cases, case-sensitivity, no-match, overlap-free repeats
`xpath-string.md` +4 (and renamed an existing mislabel) NULL input rename, CDATA, comments stripped, no-match, malformed XML error

Notes

  • I deliberately skipped one ZH `ltrim` example that claimed `LTRIM(' \\t\\n hello world')` returns `hello world` — on Apache Doris 4.1.1 LTRIM only strips ASCII spaces, so the actual output starts with the literal tab. The example was passing the ZH verifier only because its result block contained a real newline that broke the ASCII-table parser. Not porting an example whose documented output is wrong.
  • The existing `xpath-string.md` example 5 was titled "Handling CDATA and comments" but its SQL was `xpath_string(NULL, '/a')` — a pure NULL test, no CDATA. Renamed it to "NULL input" and added the actual CDATA / comments / no-match / malformed-XML examples as 6-9.

Verification

Every added example was run against a single-node Apache Doris 4.1.1 cluster; result blocks are the verbatim mysql client output (including column-width padding).

Test plan

  • All 28 added examples produce the documented result on 4.1.1.
  • Skipped LTRIM \t\n example documented in PR body.
  • xpath-string example 5 rename + 6-9 additions verified.
  • No deletions of existing examples on any page.

🤖 Generated with Claude Code

…ist on zh

For 6 string-functions doc pages the EN side has fewer examples than
the ZH side. This commit ports the ZH-only corner cases over to EN so
both pages cover the same set of behaviors. Every added example was
re-run against an Apache Doris 4.1.1 cluster and the result block is
the verbatim mysql client output.

- hex.md (+4 examples): whitespace bytes (' ', \t, \n), UTF-8
  multi-byte input, negative integer two's-complement, mixed
  alphanumeric.
- initcap.md (+6 examples): empty string, non-alphanumeric
  separators, UTF-8 words, common name capitalization, sentence
  capitalization, multiple-space and adjacent-punctuation handling.
- lcase.md (+4 examples): empty string, already-lowercase / numeric
  passthrough, non-alphabetic passthrough, UTF-8 case folding.
- ltrim.md (+6 examples): empty inputs, multi-char-substring strip,
  full match, UTF-8 substring strip, numeric strip, punctuation
  strip. (Skipped one ZH example that claimed LTRIM strips tabs and
  newlines — it actually doesn't on 4.x; LTRIM 1-arg only strips
  ASCII spaces.)
- replace.md (+4 examples): empty-string edge cases for all three
  args, case-sensitivity, no-match unchanged, overlap-free repeats.
- xpath-string.md (+4 examples) — also renamed the existing
  mislabeled example 5 "Handling CDATA and comments" to "NULL input"
  since its SQL was a pure NULL test; added the actual CDATA,
  comment-stripping, no-match, and malformed-XML examples.

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