Add embedded documentation and a system table for dictionary layouts#106182
Conversation
There was no system table exposing the available dictionary layouts. This adds `system.dictionary_layouts`, and attaches the shared `Documentation` struct (introduced for table engines) to dictionary layouts. - `DictionaryFactory::registerLayout` now takes a final `Documentation` argument, stored in `RegisteredLayout`, with a `getDocumentation` accessor. - The new `system.dictionary_layouts` table exposes `name`, `is_complex`, and the embedded documentation columns `description`, `syntax`, `examples`, `introduced_in`, and `related`. - All 21 layouts (`flat`, `hashed`, `cache`, `ip_trie`, `polygon`, …) get a description and syntax. Layouts share a single combined documentation page, so concise descriptions are used rather than embedding a full per-layout page. This is a follow-up to the embedded-documentation changes for table engines, database engines, data types, and formats, and reuses the `Documentation` struct from `src/Common/Documentation.h`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The `Docs check` job failed because the `See also` section linked to `/sql-reference/dictionaries`, which is not a valid slug, so the Docusaurus build reported a broken link. Point the link to the combined dictionary layouts reference page (`/sql-reference/statements/create/dictionary/layouts`), which is the page that documents all layouts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Master added three 04303_* stateless tests, so the dictionary layouts documentation test is renumbered to the next free prefix 04305. Verified it passes against a freshly built binary; system.dictionary_layouts populates all 21 layouts with non-empty description and syntax. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The failures of They were introduced by #104690 ("Add #104690 was merged in violation of the ClickHouse team rules: its own CI already showed these two tests failing (10 times between May 12 and June 1) before it was merged. Please update your branch to pick up the revert; the tests should pass again. |
…ocumentation # Conflicts: # src/Storages/System/attachSystemTables.cpp
|
Merged Built clean and empirically verified: |
Address review: the new `system.dictionary_layouts` table makes its columns, engine name, and table comment part of the system-table schema contract. Add a `SHOW CREATE TABLE` of it to the `02117_show_create_table_system` regression so accidental schema changes are caught, and update the reference accordingly. Verified the engine name (`SystemDictionaryLayouts`), columns, and comment against a freshly built binary. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ocumentation # Conflicts: # src/Storages/System/attachSystemTables.cpp
Add `dictionary_layouts` to the `always_accessible_tables` list in `ContextAccess::addImplicitAccessRights`, alongside the other registry introspection tables (`system.formats`, `system.data_type_families`, `system.disk_types`, etc.). Without this, users without explicit grants keep implicit `SELECT` on the comparable documentation tables but not on the new `system.dictionary_layouts`, making it unavailable when `access_control_improvements.select_from_system_db_requires_grant=true`. Update `03247_show_grants_with_implicit` accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The only CI failure here is unrelated to this PR. @groeneai, could you investigate this failure: https://github.com/ClickHouse/ClickHouse/actions/runs/27180382496/job/80245166901 and provide a fix in a separate PR? If a fix is already in progress, please link it here. |
|
@alexey-milovidov Investigated. This is not a q04 timeout or slowness bug, it is the runner-wide RSS-contention OOM on the Evidence from CIDB for the exact run you linked (q04 on this PR, 2026-06-09 12:09:37):
So no per-test fix is warranted. Disabling it would just shift the OOM to the next query, which is why I closed the equivalent q61 disable (#106797) after rienath's pushback. q35 stays disabled because it OOMs standalone with reasonable memory; q04 and q61 only die under shard-wide contention. No separate fix PR is in progress to link. The contention has self-resolved: zero q04 failures since 2026-06-11 00:00 UTC, coinciding with the revert #107122 of the multistage-distributed-queries change (#106020) that drove the heap-corruption and thread-teardown storm on the asan shards from 06-08 to 06-10. The only real fix is infra-level (lower per-shard test parallelism or raise the server memory budget on this runner), which is a shard-wide CI decision rather than a q04 change. Want me to open that, or is the self-resolution acceptable for now? |
LLVM Coverage ReportChanged lines: Changed C/C++ lines covered by tests: 153/154 (99.35%) | Lost baseline coverage: none · Uncovered code |

Fifth PR in the series that adds embedded, runtime-introspectable documentation to ClickHouse component registries (after table engines #106177, database engines #106178, data types #106180, and formats #106181). This one covers dictionary layouts — and, since there was no system table for them, adds one.
What it does:
system.dictionary_layoutstable listing every dictionary layout with itsis_complexflag and embedded documentation columnsdescription,syntax,examples,introduced_in, andrelated.Documentationstruct (src/Common/Documentation.h) throughDictionaryFactory::registerLayout, stores it inRegisteredLayout, and adds agetDocumentationaccessor.flat,hashed,sparse_hashed,hashed_array,cache,ssd_cache,direct,range_hashed,ip_trie,regexp_tree,polygon*, and theircomplex_key_*variants).Note on doc embedding: unlike engines/types/formats, dictionary layouts are all documented on a single combined reference page rather than one page per layout, so this PR uses accurate concise descriptions (with
syntaxandrelated) rather than embedding a full per-layout markdown page. The combined page therefore stays for now.Note: this PR shares
src/Common/Documentation.h/.cppwith the earlier PRs in the series (trivial add/add on merge).Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Added a new
system.dictionary_layoutstable that lists the available dictionary layouts together with embedded documentation (description,syntax,examples,introduced_in,related).Documentation entry for user-facing changes
system.dictionary_layoutsand a newsystem.dictionary_layoutssystem-table page).Version info
26.6.1.762