Repository navigation
Add embedded documentation for table engines - #106177
Conversation
Introduce a shared `Documentation` struct (`src/Common/Documentation.h`) for uniform system components. It plays the same role for table engines that `FunctionDocumentation` plays for functions, but without the function-specific fields (arguments, parameters, returned value, category). The struct is attached to table engines via `StorageFactory::registerStorage`, and `system.table_engines` now exposes `description`, `syntax`, `examples`, `introduced_in`, and `related` columns. For every engine that has a dedicated documentation page under `docs/en/engines/table-engines/`, the complete Markdown body of that page is embedded verbatim into the `description` field, so that the standalone Markdown files can later be dropped and regenerated from the embedded documentation. Engines without a dedicated page (e.g. the `Replicated*` variants, `Loop`, `WindowView`, `MaterializedView`, and the backend-specific object storage variants such as `IcebergS3`) keep a concise description. The `MergeTree` documentation exceeds the 65536-byte string literal length that C++ compilers are required to support, so its `description` is concatenated at runtime from several smaller string literals. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Workflow [PR], commit [836aaed] Summary: ✅
AI ReviewSummaryThis PR adds embedded Final VerdictStatus: ✅ Approve |
The embedded documentation added to the table-engine registration files is verbatim Markdown, which tripped the C++ style checks: - The "style error on this line" check flagged Markdown content indented by 1-3 spaces (SQL/XML examples inside code fences), read as "indentation not a multiple of 4". Such lines are left-aligned; this is a no-op for Markdown body text and only de-indents fenced examples. - Trailing whitespace and double-spaces after a comma are removed. - The whitespace-before-comma in the `StorageExecutable` Python example is fixed (`letters ,k=10` -> `letters, k=10`). - ClickHouse pretty-print output blocks had their row-number prefixes (`N. `) and border indentation realigned so the boxes line up at column 0. - The `Sql` abbreviation check is taught to ignore the canonical Apache Arrow `FlightSql.html` documentation URL referenced in `StorageArrowFlight`. #106177 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
`StorageFactory::get` rejects direct `ENGINE = ...` creation of `View`, `Loop`, `MaterializedView`, and `WindowView`, so the `syntax` advertised in `system.table_engines` for these would throw if copied verbatim. Replace it with the real user-facing forms: - `View` -> `CREATE VIEW name AS SELECT ...` - `Loop` -> `SELECT * FROM loop(database, table)` (table function only) - `MaterializedView` -> `CREATE MATERIALIZED VIEW name [TO target] AS SELECT ...` - `WindowView` -> `CREATE WINDOW VIEW name [TO target] AS SELECT ... GROUP BY tumble(...)/hop(...)` Also make the example query on the `system.table_engines` documentation page explicit about the columns it shows, so the query and the displayed response have the same shape. #106177 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The `description` and `syntax` column descriptions in `system.table_engines` no longer matched the values returned: the `description` field now often contains the full Markdown body of an engine's documentation page rather than a short summary, and `syntax` is no longer always an `ENGINE` clause now that `View`, `MaterializedView`, `WindowView`, and `Loop` expose `CREATE ...` / `SELECT ...` forms. Loosen both column descriptions so they accurately describe the values. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Addresses the review comments on the embedded documentation: - `system.table_engines` system-table page: sync the `description` and `syntax` column descriptions with the (loosened) source definitions in `StorageSystemTableEngines::getColumnsDescription`. - `S3` / `COSN` / `OSS` / `GCS`: `registerStorageS3Impl` is shared by all four engines, but embedded the S3-specific page for every one. Keep the full page for `S3` only and give `COSN`, `OSS`, and `GCS` concise provider-specific descriptions pointing back to `S3`. - `S3` / `AzureBlobStorage`: the default partition strategy is no longer `WILDCARD`. When `PARTITION BY` is used without an explicit `partition_strategy`, the default comes from `file_like_engine_default_partition_strategy`, which defaults to `HIVE`. - `Iceberg` / `Paimon`: these are no longer plain aliases for `IcebergS3` and `PaimonS3`. They auto-detect the storage backend from the `disk` setting and default to the S3 implementation only when no `disk` selects another backend. - `Join`: drop the `[TTL expr]` placeholders from the engine-specific `CREATE TABLE` syntax, since `Join` does not support column TTLs. - `NATS`: rename `nats_consumer` to the actual setting `nats_consumer_name`. - `RabbitMQ`: drop `rabbitmq_deadletter_exchange`, which is not a registered setting; dead-lettering is configured via `rabbitmq_queue_settings_list = 'x-dead-letter-exchange=...'`. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Merged latest
Built locally ( The remaining CI failures on the previous SHA are unrelated to this documentation-only change:
@groeneai, could you investigate the |
|
@alexey-milovidov Investigated. In 4 of the 5 most recent failures the killed query asked for only 551 MiB to 1.03 GiB while RSS was already pinned at the 53.69 GiB host cap, so OvercommitTracker picked q23 only because the server total was already full from other concurrent queries. q23's own footprint is small and unchanged, so there is no q23-specific memory regression to bisect. This is a runner-wide event on
Because q23's per-query ask is already under 1 GiB, no SQL setting on q23 can prevent this. The genuine fix is at the runner/memory-tracking level, and there are PRs already in flight for exactly this class: #106055, #104964, #104965, #104976. The only q23-level mitigations are (a) Given q23 demonstrably did not regress, my recommendation is to let the systemic memory PRs above resolve it and not touch q23. If you prefer a q23-specific PR now, I would do cidb session: cron:clickhouse-worker-slot-6:20260610-172400 |
The embedded `Paimon` doc and `iceberg.md` were already corrected to describe the auto-detecting behavior, but the standalone `paimon.md` still said `Table engine Paimon is an alias to PaimonS3 now`. Mirror the embedded `registerStorageObjectStorage.cpp` wording so both copies stay in sync. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Pushed CI triage of the previous run (sha
@groeneai, the |
|
@alexey-milovidov Confirmed. The Evidence (CIDB, table
Tracking issue status: there is no open umbrella issue for the runner-wide |
|
📊 Cloud Performance Report 🔴 AI verdict: 2 regressed query(s). K_source=6 K_base=30 flagged=6/65 clickbench🟢 2 improved Flagged queries (2 of 43)
q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_official🔴 2 regressed · 🟢 2 improved Flagged queries (4 of 22)
q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. Debug info
|
Address review findings on the embedded table-engine documentation, fixing both the embedded copies and the corresponding standalone Markdown pages so the two stay in sync: - `NATS`: `nats_reconnect_wait` default is `2000`, not `5000` (matches `NATSSettings`). - `S3Queue`: rename the `enable_logging_to_s3queue_log` section to `enable_logging_to_queue_log` (the former is only an alias) and document its real default of `1`. - `S3Queue`: `persistent_processing_node_ttl_seconds` default is `21600` (6 hours), not `3600`, and the same TTL is used for the `Ordered`-mode bucket lock. - `AggregatingMergeTree`, `SummingMergeTree`, `CoalescingMergeTree`: embed the `Tuple element aggregation` section that was present only in the standalone pages. - `Join`: use commas between `VALUES` rows in the examples to match idiomatic ClickHouse documentation. - `PaimonS3`: remove the `[,structure]` argument from the table-engine syntax; table engines initialize object-storage configs with `with_table_structure` set to `false`, so `structure` is not accepted. - `S3` and `AzureBlobStorage`: the `partition_strategy` default is compatibility-controlled (`WILDCARD` under `compatibility` older than `26.6`, `HIVE` otherwise), matching the standalone `s3.md` wording. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 8917/8926 (99.90%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 3 line(s) · Uncovered code |
alexey-milovidov
left a comment
There was a problem hiding this comment.
This is amazing - a huge progress!
|
@alexey-milovidov Filed the umbrella tracking issue: #108689. Re-confirmed it is the runner-wide host OOM (server killed externally, not a per-query limit, not the #106020 UAF):
The early-June box-wide storm self-resolved tracking the #107122 revert (kills on the shard 06-09..06-13: 13, 93, 59, 6, 1). It now persists as low steady-state host-RSS pressure (~2-7/day on that shard). #107037 (the per-test victim issue) was closed, so there was no open umbrella tracker for the class. Cross-referenced the memory-tracking work in the issue (#106055 just merged, #104964 merged, #104965 / #104976 open). |
Many parts of the ClickHouse codebase carry embedded documentation that is introspectable at runtime and used to generate the website documentation: scalar functions, aggregate functions, table functions, and settings all do. Table engines did not.
This PR adds embedded documentation for table engines. It is the first in a planned series that will do the same for database engines, data types, input/output formats, dictionary layouts, dictionary sources, and so on.
What it does:
Documentationstruct (src/Common/Documentation.h) for uniform system components. It plays the same role for table engines thatFunctionDocumentationplays for functions, but without the function-specific fields (arguments, parameters, returned value, category).Documentationto every table engine viaStorageFactory::registerStorage.system.table_enginesnow exposesdescription,syntax,examples,introduced_in, andrelatedcolumns.docs/en/engines/table-engines/, the complete Markdown body of that page is embedded verbatim into thedescriptionfield, so that the standalone Markdown files can later be dropped and regenerated from the embedded documentation. Engines without a dedicated page (e.g. theReplicated*variants,Loop,WindowView,MaterializedView, and the backend-specific object storage variants such asIcebergS3) keep a concise description for now.Implementation note: the
MergeTreedocumentation exceeds the 65536-byte string literal length that C++ compilers are required to support, so itsdescriptionis concatenated at runtime from several smaller string literals.Follow-up (not in this PR): a generator that writes the Markdown pages from the embedded documentation, after which the standalone
.mdfiles can be removed.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Table engines now carry embedded documentation, introspectable via the new
description,syntax,examples,introduced_in, andrelatedcolumns of thesystem.table_enginestable.Documentation entry for user-facing changes
system.table_enginesand an updatedsystem.table_enginessystem-table page).Version info
26.6.1.788