Repository navigation
Docs: move SQL statement pages into source - #115608
Conversation
|
Workflow [PR], commit [ba6df6a] Summary: ❌
AI ReviewSummaryThis PR moves the 99 SQL statement page bodies into parser-side Findings
💡 Nits
Final VerdictChanges requested until the generated LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 12360/12360 (100.00%) · Uncovered code |
Use the established `DOCS_MD` raw-string delimiter and skip embedded docs in the `!!!` check. CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=115608&sha=9253de56a0fcf3fd501190170455d243aa619684&name_0=PR&name_1=Style%20check Related: ClickHouse#115608
Expect `system.documentation` to preserve complete statement pages without synthetic `Part of` sections, and synchronize the `EXPLAIN` statistics spelling after merging `master`. Related: ClickHouse#115608
Trim embedded statement descriptions before exposing them so `system.statements` and `system.documentation` agree. Update the stale expected result for the no-synthetic-section assertion. Related: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=115608&sha=0a84216bd888ab324bbdd9791b6595fddad88d39&name_0=PR&name_1=Fast%20test Related: ClickHouse#115608
| attach<StorageSystemDocumentation>(context, system_database, "documentation", "Collects the embedded documentation of the components of the system (functions, table engines, data types, settings, profile events, metrics, system tables, etc.) into a single table, with the reference documentation rendered as Markdown and the path to the source file where it is defined."); | ||
| attach<StorageSystemCollations>(context, system_database, "collations", "Contains a list of all available collations for alphabetical comparison of strings."); | ||
| attach<StorageSystemDatabaseEngines>(context, system_database, "database_engines", "Contains a list of all available database engines"); | ||
| attach<StorageSystemStatements>(context, system_database, "statements", "Contains a list of all SQL statements of ClickHouse."); |
There was a problem hiding this comment.
system.statements is a new public system table, but this PR does not add the generated reference page under docs/reference/system-tables/. utils/generate-system-tables-docs creates one .mdx file per table from the table comment and column comments; without the generated statements.mdx, the website ships the new table with no system-table reference page at all.
There was a problem hiding this comment.
It will get added during the nightly generation job
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Object file sizes47 object files changed (+976.75 KiB total), 0 added.
737 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units51 translation units recompiled, 110 s compile time in total, 51 of them have a recent master baseline. |
# Conflicts: # docs/reference/statements/alter/named-collection.mdx # docs/reference/statements/alter/user.mdx # docs/reference/statements/create/named-collection.mdx # docs/reference/statements/create/user.mdx
|
|
||
| For system tables, the documentation is the table comment together with the list of its columns (the name, type and description of each). | ||
|
|
||
| For SQL statements, the documentation is the same as the one exposed by `system.statements`: it also names the enclosing statement, if any, e.g. the `WHERE` clause is a part of `SELECT`. |
There was a problem hiding this comment.
This sentence no longer matches the implementation. StorageSystemDocumentation now adds Statement rows with addFullPageDocumented, so system.documentation.description is just the trimmed page body from system.statements and does not append a synthetic **Part of:** section; tests/queries/0_stateless/04927_system_documentation_statements.sql asserts exactly that. As written, the published docs promise information that the table does not expose.
There was a problem hiding this comment.
The current code still defines addFullPageDocumented at src/Storages/System/StorageSystemDocumentation.cpp:370 and still routes statements through it at src/Storages/System/StorageSystemDocumentation.cpp:978, so system.documentation is still built from the trimmed page body and still omits the synthetic **Part of:** section.
|
|
||
| For system tables, the documentation is the table comment together with the list of its columns (the name, type and description of each). | ||
|
|
||
| For SQL statements, the documentation is the same as the one exposed by `system.statements`: it also names the enclosing statement, if any, e.g. the `WHERE` clause is a part of `SELECT`. |
There was a problem hiding this comment.
This sentence no longer matches the contract of the current implementation. StorageSystemDocumentation now adds Statement rows via addFullPageDocumented, and 04927_system_documentation_statements.sql explicitly checks that system.documentation does not append synthetic **Part of:** sections for statements. So the enclosing statement is only exposed via system.statements.parent_name; here the docs should describe the verbatim page body instead.
There was a problem hiding this comment.
The current code still defines addFullPageDocumented at src/Storages/System/StorageSystemDocumentation.cpp:370 and still routes statements through it at src/Storages/System/StorageSystemDocumentation.cpp:978, so system.documentation is still built from the trimmed page body and still omits the synthetic **Part of:** section.
|
@groeneai is it safe to merge? |
f6a91ed
Moves the 99 canonical SQL statement reference page bodies into the
Documentation::descriptionfields introduced by #115341.The Markdown pages keep their existing frontmatter and gain
AUTOGENERATED_START/AUTOGENERATED_ENDmarkers around the source-owned body.system.documentationnow exposes the same complete page body without appending duplicate structured sections. The statement index and 31 dictionary subtopic pages remain hand-written.Related: #115341
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Workflow [PR]
Sync PR [sync-upstream/pr/115608]