Repository navigation
Add embedded documentation for aggregate function combinators - #106185
Conversation
Attach the shared `Documentation` struct (introduced for table engines) to aggregate function combinators, and expose `description`, `syntax`, `examples`, `introduced_in`, and `related` columns on `system.aggregate_function_combinators`. - `AggregateFunctionCombinatorFactory::registerCombinator` now takes a final `Documentation` argument, stored in `CombinatorPair`. - All 14 combinators (`If`, `Array`, `ForEach`, `Map`, `State`, `SimpleState`, `Merge`, `Null`, `OrNull`, `OrDefault`, `Distinct`, `Resample`, `ArgMin`, `ArgMax`) get a description and syntax. Combinators are documented on a single combined page, so concise descriptions are used. `StorageSystemCompletions` is updated for the additional `CombinatorPair` field. This is a follow-up to the embedded-documentation changes for table engines, database engines, data types, formats, and dictionary layouts/sources, and reuses the `Documentation` struct from `src/Common/Documentation.h`. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Workflow [PR], commit [1cfb634] Summary: ✅
AI ReviewSummaryThis PR threads shared Findings
Tests
Final VerdictStatus: Minimum required action: broaden the regression test so the new |
Addresses review feedback on the embedded documentation exposed via `system.aggregate_function_combinators`: - `ArgMin`/`ArgMax`: the previous text described only the single nested argument case (`sumArgMin(x, key)`). In general the last argument is the comparable key and the nested aggregate processes all preceding arguments, which may be zero (`countArgMin(key)`), one (`sumArgMin(x, key)`), or several (`corrArgMin(x, y, key)`). The description and `syntax` now reflect this general calling convention. - `Resample`: the `syntax` omitted the second parameter list that supplies the nested aggregate arguments and the resampling key. It is now `<aggregate_function>Resample(start, end, step)(<aggregate_function_arguments>, resampling_key)`, matching the public documentation. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
`AggregateFunctionSimpleState::insertResultInto` delegates to the nested function, so the combinator returns the final aggregation result value (typed as `SimpleAggregateFunction`), not a serialized intermediate state. The previous wording described it like `State`, which would teach an incorrect calling convention via `system.aggregate_function_combinators`. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
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. |
|
Merged The shared Verified locally: rebuilt |
|
Merged The CI reds are all unrelated, pre-existing flakies:
|
|
@groeneai, fix test_parallel_replicas_over_distributed/test.py::test_parallel_replicas_over_distributed[test_multiple_shards_multiple_replicas-10-1] and send a PR with the fix. |
|
@alexey-milovidov this isn't a The actual race (from Producer and consumer touch the same 8-byte field of the same CIDB, 90d: 1100+ I am hesitant to patch the queue speculatively without a local TSan repro, and a session: cron:clickhouse-ci-task-worker:20260609-020700 |
|
I couldn't figure out the NonblockingBoundedQueue TSAN error. Here's a PR that may or may not have any effect on it: #106801 |
|
Thanks for taking a look. Reading #106801: the second I will track the CIDB signal after #106801 merges:
Session: cron:clickhouse-ci-task-worker:20260609-081800 |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 90/90 (100.00%) | Lost baseline coverage: none · Uncovered code |
|
@groeneai, send a follow-up PR. The documentation should be as complete as the Markdown docs on the website. We can copy Markdown docs directly to the source code. The end goal is to make Markdown docs fully generated from the source code. |
Part of the series adding embedded, runtime-introspectable documentation to ClickHouse component registries (table engines #106177, database engines #106178, data types #106180, formats #106181, dictionary layouts #106182, dictionary sources #106184). This one covers aggregate function combinators.
What it does:
Documentationstruct (src/Common/Documentation.h) throughAggregateFunctionCombinatorFactory::registerCombinator, storing it inCombinatorPair.system.aggregate_function_combinatorsnow exposesdescription,syntax,examples,introduced_in, andrelatedcolumns (previously onlyname,is_internal).If,Array,ForEach,Map,State,SimpleState,Merge,Null,OrNull,OrDefault,Distinct,Resample,ArgMin,ArgMax.Note on doc embedding: combinators are documented on a single combined reference page rather than one page per combinator, so this PR uses accurate concise descriptions (with
syntaxandrelated) rather than embedding a full per-combinator markdown page.StorageSystemCompletionsis updated for the additionalCombinatorPairfield. This PR sharessrc/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):
Aggregate function combinators now carry embedded documentation, introspectable via the new
description,syntax,examples,introduced_in, andrelatedcolumns of thesystem.aggregate_function_combinatorstable.Documentation entry for user-facing changes
system.aggregate_function_combinators).Version info
26.6.1.761