Skip to content

[fix](sql-functions) provide setup data for date-time-function examples querying an undefined table#3875

Merged
morningman merged 1 commit into
apache:masterfrom
boluor:fix/phantom-table-setup-date-time-functions
Jun 3, 2026
Merged

[fix](sql-functions) provide setup data for date-time-function examples querying an undefined table#3875
morningman merged 1 commit into
apache:masterfrom
boluor:fix/phantom-table-setup-date-time-functions

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented Jun 2, 2026

The PERIOD_ADD, PERIOD_DIFF and TIME_FORMAT pages each show a SELECT ... FROM <table> example with an expected result, but never define the table on the page. 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 table, carried in a standard HTML comment (<!-- setup-sql ... -->) just before the example. Because it is an HTML comment, the rendered page is unchanged and no documented expected output is modified.

Table contents were reverse-derived from the output already printed on each page and verified end-to-end on the matching cluster for each doc tree.

Pages and tables

Function Table(s)
PERIOD_ADD test_period_add
PERIOD_DIFF test_period_diff
TIME_FORMAT test_time_format, test_format

These pages exist only in the dev/current and version-4.x trees; updated in EN + ZH (12 files). Verified on a 4.1.1 cluster (4.x) and a master build (dev): the affected examples failed with "table does not exist" before this change and pass (output matches the doc, including the full TIME_FORMAT specifier table) after it. No ja-source changes.

🤖 Generated with Claude Code

…es querying an undefined table

PERIOD_ADD, PERIOD_DIFF and TIME_FORMAT each show a `SELECT ... FROM <table>`
example with an expected result, but never define the table on the page, so the
examples cannot be run or reproduced ("table does not exist").

Add the missing CREATE TABLE + INSERT for each table, carried in a standard HTML
comment (`<!-- setup-sql ... -->`) before the example. As an HTML comment it does
not change the rendered page, and no documented expected output is modified.

Table contents were reverse-derived from the output already printed on each page
(test_period_add, test_period_diff, test_time_format + test_format) and verified
end-to-end: version-4.x on a 4.1.1 cluster and dev/current on a master build. On
both trees the examples failed with "table does not exist" before and now resolve
and match the documented output, including the large TIME_FORMAT specifier table.

Pages exist only in dev/current and version-4.x; updated in EN + ZH (12 files).

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