Skip to content

[fix](sql-functions) provide setup data for examples querying an undefined table#3872

Merged
morningman merged 3 commits into
apache:masterfrom
boluor:fix/phantom-table-setup-sql-comments
Jun 3, 2026
Merged

[fix](sql-functions) provide setup data for examples querying an undefined table#3872
morningman merged 3 commits into
apache:masterfrom
boluor:fix/phantom-table-setup-sql-comments

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented Jun 2, 2026

Several SQL-function reference pages contain examples of the form SELECT ... FROM <table> together with an expected result table, but the page never defines <table>. As written these examples cannot be run or reproduced — a reader who copies them gets Table [...] does not exist.

This PR adds the missing CREATE TABLE + INSERT for each such table, carried in a standard HTML comment (<!-- setup-sql ... -->) placed just before the first example that uses the table. Because it is an HTML comment, the rendered page is unchanged and no documented expected output is modified — the comment only records the data the examples already assume, making each example self-contained and reproducible.

The table contents were reverse-derived from the output already printed on each page (e.g. get_format_test from its SELECT *, test_maketime from its shown hour/minute/sec columns) and verified end-to-end on a live cluster of the matching release for every doc tree.

Pages and version coverage

Function Table dev (current) version-4.x version-3.x version-2.1
GET_FORMAT get_format_test — (page absent) — (page absent)
MAKETIME test_maketime — (page absent) — (page absent)
CONVERT_TO class_test
IPV4_NUM_TO_STRING ipv4_bi
IPV4_STRING_TO_NUM_OR_NULL ipv4_str

Each ✅ is updated in EN + ZH. Verification clusters: dev/current + version-4.x on a 4.1.1 build and a master daily build; version-3.x on a 3.1.4 cluster; version-2.1 on a 2.1.11 cluster. On every tree the affected examples failed with "table does not exist" before the change and pass (output matches the doc cell-for-cell) after it.

No ja-source changes.

🤖 Generated with Claude Code

boluor and others added 3 commits June 2, 2026 06:02
…fined table

Several SQL-function reference pages show examples of the form
`SELECT ... FROM <table>` with an expected result, but never define `<table>`
on the page, so the examples cannot be run or reproduced (a reader copying
them gets `Table [...] does not exist`).

Add the missing CREATE TABLE + INSERT for each such table, carried in a
standard HTML comment (`<!-- setup-sql ... -->`) just before the first example
that uses the table. As an HTML comment it does not change the rendered page,
and no documented expected output is modified — it only records the data the
examples already assume, making each example self-contained and reproducible.

Table contents were reverse-derived from the output already printed on each
page and verified end-to-end on a Doris 4.1.1 cluster: every example now
resolves its table and matches the documented output cell-for-cell.

Pages (EN + ZH, version-4.x): GET_FORMAT, MAKETIME, CONVERT_TO,
IPV4_NUM_TO_STRING, IPV4_STRING_TO_NUM_OR_NULL.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nt) docs

Mirror the version-4.x change onto the dev/current copies of the same five
pages (docs/ EN + i18n/.../current ZH). These files were byte-identical to the
version-4.x originals, so the same `<!-- setup-sql ... -->` CREATE+INSERT
applies unchanged.

Verified end-to-end on a master build (doris-0.0.0, daily output): before the
change every `... FROM <table>` example failed with "table does not exist"; after
it, all examples resolve their table and match the documented output. Rendered
page and documented expected output are unchanged (HTML comment only).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…sion-2.1

Extend the same fix to the three affected pages that also exist in the 3.x and
2.1 doc trees (EN + ZH): CONVERT_TO, IPV4_NUM_TO_STRING, IPV4_STRING_TO_NUM_OR_NULL.
GET_FORMAT and MAKETIME do not exist in 3.x/2.1, so they are not touched.

For CONVERT_TO and IPV4_STRING_TO_NUM_OR_NULL the pages are byte-identical to
version-4.x, so the same `<!-- setup-sql ... -->` block applies. For
IPV4_NUM_TO_STRING the 3.x/2.1 pages differ from 4.x only in frontmatter/heading,
so the setup block was inserted at the same example anchor without touching the
rest of the page.

Verified end-to-end on the matching release clusters: version-3.x docs on a
3.1.4 cluster, version-2.1 docs on a 2.1.11 cluster. Every example now resolves
its table and matches the documented output; no rendered output or expected
result is modified.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@morningman morningman merged commit 1563a2e into apache:master Jun 3, 2026
3 of 4 checks passed
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