Skip to content

Make SQL examples in embedded documentation runnable - #108556

Merged
alexey-milovidov merged 12 commits into
masterfrom
docs-fix-embedded-doc-examples
Jul 1, 2026
Merged

alexey-milovidov merged 12 commits into
masterfrom
docs-fix-embedded-doc-examples

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Jun 25, 2026 •

Copy link
Copy Markdown
Member

Many query/response examples embedded in system.documentation (rendered from the inline FunctionDocumentation/Documentation in the source — the same content published on the website) did not run as written. This PR makes them runnable and self-contained, without changing what each example demonstrates.

What changed:

  • Added SET <setting> = 1; to examples that require a non-default setting: experimental TimeSeries aggregate functions (allow_experimental_time_series_aggregate_functions), enable_nullable_tuple_type (RowBinary), deprecated error-prone window functions (allow_deprecated_error_prone_window_functions), the experimental Dynamic/Variant types, and variant_throw_on_type_mismatch for the functions-with-Variant-arguments examples.
  • Duplicated the dictionary creation (source table + CREATE DICTIONARY with a local SOURCE(CLICKHOUSE(...))) into every dictGet* example so each one is self-contained.
  • Fixed genuine bugs: emptyArray* missing (); a table named with the reserved word table in hasAllTokens/hasAnyTokens; stale toTime/toTime64 signatures; missing training data for stochasticLinearRegression/stochasticLogisticRegression; non-deterministic arrayJoin examples (added ORDER BY). Affected responses were regenerated to match actual output.

Each fixed example was verified to run successfully in clickhouse-local against a build of this branch.

Changelog category (leave one):

  • Documentation (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Made the SQL examples embedded in system.documentation runnable and self-contained.

Version info

  • Merged into: 26.7.1.363 (included in 26.7 and later)

Many query/response examples embedded in `system.documentation` (rendered
from the inline `FunctionDocumentation`/`Documentation` in the source) did not
run as written. This makes them runnable and self-contained:

- Add `SET <setting> = 1;` to examples that require a non-default setting:
  experimental TimeSeries aggregate functions
  (`allow_experimental_time_series_aggregate_functions`),
  `enable_nullable_tuple_type` (`RowBinary`), deprecated snowflake/window
  functions, the experimental `Dynamic`/`Variant` types, and
  `variant_throw_on_type_mismatch` for the functions-with-`Variant`-arguments
  examples.
- Duplicate the dictionary creation (source table + `CREATE DICTIONARY` with a
  local `SOURCE(CLICKHOUSE(...))`) into every `dictGet*` example so each is
  self-contained.
- Fix genuine bugs: `emptyArray*` missing `()`; a table named with the reserved
  word `table` in `hasAllTokens`/`hasAnyTokens`; stale `toTime`/`toTime64`
  signatures; missing training data for `stochasticLinearRegression`/
  `stochasticLogisticRegression`; non-deterministic `arrayJoin` examples (added
  `ORDER BY`). Affected responses were regenerated.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [52b6ebc]

Summary: ✅


AI Review

Summary

This PR is a documentation-only pass over embedded system.documentation examples, mainly adding required settings and setup SQL so the affected snippets are runnable and deterministic. I reviewed the current combined diff and the prior inline/top-level discussion; the previous bot-authored findings are fixed in the current code, and I found no new issues requiring inline review comments.

Final Verdict

Status: ✅ Approve

No minimum required actions.

@clickhouse-gh clickhouse-gh Bot added the pr-documentation Documentation PRs for the specific code PR label Jun 25, 2026
Comment thread src/DataTypes/DataTypeDynamic.cpp Outdated
Using `Dynamic` type in table column definition:

```sql
SET allow_experimental_dynamic_type = 1;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the default, we don't need this setting.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in facdf54 — removed. allow_experimental_dynamic_type is obsolete (default-on now), so the example runs without it.

Comment thread src/DataTypes/DataTypeVariant.cpp Outdated
Using `Variant` type in table column definition:

```sql
SET allow_experimental_variant_type = 1;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the default, we don't need this setting.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in facdf54 — removed for the same reason (allow_experimental_variant_type is obsolete/default-on). Kept variant_throw_on_type_mismatch = 0 only where an example relies on the NULL-for-incompatible behavior.

)",
R"(
14:30:25
1970-01-02 14:30:25

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should enable something so that this function returns Time

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in facdf54 — added SET use_legacy_to_time = 0 (plus enable_time_time64_type = 1) so toTime returns Time; the responses are updated to the Time value (14:30:25).

Comment thread src/Functions/getClientHTTPHeader.cpp Resolved
- Dynamic/Variant: remove `SET allow_experimental_dynamic_type`/
  `allow_experimental_variant_type` — both are obsolete (default-on now).
- `toTime`: enable `Time` output via `SET use_legacy_to_time = 0` (+
  `enable_time_time64_type = 1`); responses updated to the `Time` value.
- `toTime64`: fix structured syntax to `toTime64(x, scale)` and add the
  `scale` argument; add `SET enable_time_time64_type = 1` to the examples.
- `dictGet*` examples: use `DB currentDatabase()` instead of hard-coded
  `DB 'default'` so they work in any current database.
- `stochasticLinearRegression`/`stochasticLogisticRegression`: make every
  example self-contained (each creates its own training data/model).
- `getClientHTTPHeader`: show an explicit HTTP request (the function reads
  request headers, so it only returns a value over the HTTP interface).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Comment thread src/Functions/hasAnyAllTokens.cpp Resolved
Comment thread src/Functions/FunctionDictGetKeys.cpp Resolved
…nistic

Following the AI review on the PR:

- `hasAnyTokens`/`hasAllTokens`: each `FunctionDocumentation::Examples`
  entry is rendered by `examplesAsString` as its own query block, but
  several entries only ran `SELECT ... FROM doc`/`FROM log` and relied on
  a previous entry to create the table, so they failed with
  `UNKNOWN_TABLE` when run independently. Duplicated the
  `CREATE TABLE`/`INSERT` setup into every dependent entry (matching the
  `dictGet*` approach in this PR) so each block is self-contained.

- `toTime`: the integer-to-`Time` example used `toDateTime(52225)`, whose
  result depends on the server time zone, so the documented `14:30:25`
  only held on a UTC server. Made the source time zone explicit with
  `toDateTime(52225, 'UTC')` so the example is deterministic.

- `dictGetKeys`: the example compared the exact array order `[4,2]`, but
  `dictGetKeys` returns keys in dictionary scan order (`HASHED` iterates
  hash containers), which is not a documented guarantee. Wrapped the
  result in `arraySort` and updated the expected output to `[2,4]`.

Verified each changed example runs in `clickhouse-local`, including the
`toTime` case under non-UTC time zones.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Comment thread src/Functions/greatest.cpp Resolved
Comment thread src/Functions/least.cpp Resolved
Comment thread src/Functions/runningDifference.cpp Resolved
alexey-milovidov and others added 2 commits June 26, 2026 19:33
- `toTime64`: return type documented as `Time64` (was `Time64(6)`) since
  the result scale follows the `scale` argument.
- `toTime`: add `DateTime64` to the documented argument types (the example
  uses a `DateTime64` input).
- `runningDifference`: order the example by `EventTime, EventID` so rows with
  equal `EventTime` have a deterministic order.
- `least`/`greatest`: replace `now()` in the DateTime example with fixed
  literals so the documented response is reproducible.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@dhtclk
dhtclk self-requested a review June 26, 2026 21:50
The `enable_nullable_tuple_type` setting is required only to create a
`Nullable(Tuple(...))` type. It had been added to 16 RowBinary examples that
do not use such a type (Map, Variant, Dynamic, Point/Geometry,
SimpleAggregateFunction states, QBit, ...) — all of which run without it. The
one block that genuinely uses `Array(Nullable(Tuple(UInt32, String)))` (the
complex-Tuple illustration) lacked the setting and failed.

Remove the 16 unnecessary `SET enable_nullable_tuple_type = 1;` lines and add
the setting to the block that actually needs it.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Comment thread src/Functions/getClientHTTPHeader.cpp Resolved
…64 unit

Two issues raised in PR review on the embedded documentation examples:

- `getClientHTTPHeader`: the `Example::query` stored an `echo ... | curl`
  shell pipeline, but `FunctionDocumentation::examplesAsString` always
  renders that field inside a `sql` query block, so consumers of
  `system.documentation` that execute the example would try to run the
  shell command as SQL. Moved the HTTP `curl` invocation into the
  description prose (a `bash` block) and made the example a valid,
  runnable SQL query: the empty-header case over a non-HTTP interface
  with `SETTINGS allow_get_client_http_header = 1`.

- `toTime64`: the description said numeric arguments represent
  microseconds since midnight, but the implementation
  (`ToTime64TransformUnsigned`/`ToTime64TransformSigned` multiply the
  numeric value by the requested scale) and the example treat them as
  seconds since midnight (`toTime64(52225.123456, 6)` is `14:30:25.123456`).
  Updated the description to say seconds since midnight, matching `toTime`,
  and clarified that the precision depends on `scale`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator

@alexey-milovidov This is not caused by this PR and there is no code to fix here. It is a known fuzzer-harness false positive, already fixed on master.

What happened on that run (sha 28d5e71, 2026-06-27 02:48 UTC):

  • status.tsv was 1 0 143: fuzzer exited 143 (normal 30m timeout) and the server exited 0 (clean), but server_died was set to 1.
  • That flag came from the post-fuzz liveness probe clickhouse-client --receive_timeout=5 --query "SELECT 1" hitting its 5s timeout (Timeout exceeded while receiving data from server). The arm ASAN server was alive but slow to answer right after 30m of fuzzing. server.log has no crash, no OOM, no sanitizer report, only the normal shutdown "Received signal 15".
  • ast_fuzzer_job.py checks server_died before the exit-143 OK branch, so the clean run was reported as a FAIL whose only "stack" is that shutdown line.

This signature has 0 master hits and 7 unrelated PRs in the last 30 days, and arm_asan_ubsan passed on 3 earlier commits of this same PR, so it is transient, not a regression.

Already fixed by #108582 (merged 2026-06-27 17:06 UTC), which retries on a probe timeout instead of declaring the server dead on the first one. This branch predates that merge. Merge master into the branch and re-run; the check will pass.

Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108556&sha=28d5e71b2ec5bd03b95178091a4051789b987190&name_0=PR&name_1=AST%20fuzzer%20%28arm_asan_ubsan%29

@alexey-milovidov

Copy link
Copy Markdown
Member Author

Merged master to refresh the branch (it was ~283 commits behind and the only test red was a flake).

Conflict resolution: the single merge conflict was src/Functions/snowflake.cpp (modify/delete). master removed the deprecated snowflake conversion functions entirely in aa89258d6c5 ("Remove deprecated snowflake conversion functions") and obsoleted allow_deprecated_snowflake_conversion_functions, so the doc-example edits this PR made to that file are moot — I accepted the deletion. The PR description was updated accordingly (the snowflake examples are gone; the deprecated window functions part is unaffected). The only other touched-by-both file, src/DataTypes/DataTypeVariant.cpp, auto-merged cleanly (this PR's SET lines + master's ```sql → ```text output-block relabels both present).

CH Inc sync: the private sync PR had the identical snowflake.cpp modify/delete conflict against private master; resolved the same way and pushed, so the sync PR is MERGEABLE again.

Remaining red — not caused by this PR: Stress test (amd_msan) → Logical error: 'Unexpected exception in refresh scheduling' in RefreshTask::doScheduling (RefreshTask.cpp:939). This is the chronic master-wide flake tracked by #106737 (STID 2508-3e7b), still recurring across ~19 PRs/day. It is unrelated to a documentation-only change: no test executes the embedded system.documentation examples (the 04357/04409 tests only check structure/metadata), and this PR adds no tests.

@clickhouse-gh

clickhouse-gh Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 38 queries analysed

This PR only edits embedded documentation examples in function/aggregate-function source files (adding CREATE TABLE/dictionary setup, SET statements, and expected outputs) — it changes no query-execution code. Neither ClickBench Q15 (-12.29%) nor Q32 (-5.03%) exercises any path this PR touches, so both deltas are run-to-run variance rather than real effects of the change. Q15's flagged improvement is downgraded to not sure, and Q32 remains not sure. No action needed from the author.

clickbench

⚠️ 2 inconclusive

Flagged queries (2 of 43)
Query Verdict Baseline median (ms) PR median (ms) Change q-value Hint
⚠️ 15 not_sure 236 207 -12.3% <0.0001 PR only edits embedded doc examples; nothing in Q15's execution path changes, so the -12% is run-to-run variance
⚠️ 32 not_sure 1321 1254 -5.0% <0.0001 Doc-only PR; -5% delta is borderline and unrelated to anything Q32 executes

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

🟢 No significant changes

Debug info
  • StressHouse run: bcfa75c6-29a6-444a-a05e-0d62a189998a
  • MIRAI run: 88760ebb-2852-45d1-a635-026640daddbd
  • PR check IDs:
    • clickbench_588309_1782886367
    • clickbench_588315_1782886367
    • clickbench_588325_1782886367
    • tpch_adapted_1_official_588338_1782886367
    • tpch_adapted_1_official_588348_1782886367

`FunctionDocumentation::examplesAsString` renders each `Examples` entry
as a separate, independently runnable SQL block. Previously only the
first `timeSeriesLastTwoSamples` example created `t_raw_timeseries` /
`t_resampled_timeseries_15_sec` and enabled
`allow_experimental_time_series_aggregate_functions`, so the remaining
three blocks failed with `UNKNOWN_TABLE` (and, for the `idelta`/`irate`
examples, an experimental-function exception, since
`timeSeriesInstantDeltaToGrid` / `timeSeriesInstantRateToGrid` are gated
by the same setting) when run on their own.

Each dependent example now prepends the setup it needs: the two
re-sampled-data examples re-create both tables, the materialized view,
and the insert; the raw-data `idelta`/`irate` example only re-creates
and populates `t_raw_timeseries`. Every block was verified to run
standalone in `clickhouse-local` and reproduce the documented output.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

@groeneai, fix 04093_msan_fiber_distributed_false_positive

@groeneai

Copy link
Copy Markdown
Collaborator

04093_msan_fiber_distributed_false_positive failed here with the UNEXPECTED_PACKET_FROM_SERVER ("expected TablesStatusResponse, got ProfileInfo") desync, not an MSan fiber issue. That desync is a fresh master-wide regression (0 hits in the prior 29 days, then 72 hits across 24 tests / 13 master runs / 54 PRs starting 2026-06-29 17:54:38Z) and is already fixed by your #108854. Details + the regression source (b681776, #108630) in #108854 (comment). Nothing in this docs PR is involved; the failure will clear once #108854 merges.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

Continuation triage (head 3767ba4cc8b)

Status: MERGEABLE / BLOCKED · AI Review ✅ Approve · @dhtclk APPROVED · 0 actionable unresolved threads (the 3 remaining are outdated self-notes already addressed in facdf541968). No code changes were needed this pass — the diff is confined to FunctionDocumentation/Documentation example strings (no executable code), so none of the CI reds can originate here.

All 4 reds are unrelated:

  1. Stateless tests (amd_debug, parallel) → 04093_msan_fiber_distributed_false_positive: the fresh master-wide UNEXPECTED_PACKET_FROM_SERVER ("expected TablesStatusResponse, got ProfileInfo") desync from b681776 (Prune stale Darwin fast-test skips; fix isLocalAddress for lo0 aliases #108630, merged 06-29 17:21Z — already in this branch's merge-base). Fixed by Fix flaky distributed query "Unexpected packet from server (expected TablesStatusResponse, got ProfileInfo)" #108854 (open); will clear once it lands. Already triaged in this thread.
  2. AST fuzzer (amd_debug, targeted, old_compatibility) → Invalid number of columns in chunk pushed to OutputPort (STID 2270-3452) in JoiningTransform: known recurring JOIN fuzz flake (Logical error: Invalid number of columns in chunk pushed to OutputPort. Expected A, found B (STID: 2270-3452) #96656 / Logical error: Invalid number of columns in chunk pushed to OutputPort. Expected A, found B (STID: 2270-3452) #100923 — exact STID; Logical error: Invalid number of columns in chunk pushed to OutputPort. Expected A, found B (STID: 2270-32ca) #103695 — same logical error). No FORMAT/documentation path involved.
    3 & 4. Stress test (amd_tsan) + Stress test (arm_tsan) → Hung check failed, possible deadlock found: known Hung check failed, possible deadlock found #107941.

No master re-merge: merge-base f442bc039c2 is from 06-29 17:58Z (< 1 day fresh, already past #108630), and none of the reds are fixable by merging master (#108854 not yet merged; the others are chronic flakes). The branch is ready to merge once #108854 lands and the flaky stress/fuzzer checks are re-run.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

Continuation re-check (head 3767ba4cc8b, no new commit)

Status unchanged since the previous pass: MERGEABLE / BLOCKED · AI Review ✅ Approve · @dhtclk APPROVED · 0 actionable unresolved threads (the 3 remaining are outdated self-notes already addressed in facdf541968). The diff is confined to FunctionDocumentation/Documentation example strings — no test files and no executable code paths — so none of the CI reds can originate here. No code changes needed.

Independently re-verified the two stateless/fuzzer reds against CIDB (last 30d):

Re-ran the failed flaky jobs to try to flip CI green and unblock the merge. No master re-merge: merge-base is still < 1 day fresh (06-29 17:58Z, already past #108630), and none of the reds are fixable by merging master (#108854 not yet merged; the rest are chronic flakes). Ready to merge once the flakes clear / #108854 lands.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

Continuation triage (head 3767ba4cc8b)

Status: MERGEABLE / BLOCKED · AI Review ✅ Approve · @dhtclk APPROVED · 0 actionable unresolved threads (the 3 remaining are isOutdated self-notes already addressed in facdf541968). No code changes needed — the diff is confined to FunctionDocumentation/Documentation example strings (verified: every changed hunk is SQL inside an embedded doc string; no executable code, no test files), so none of the CI reds can originate here.

The reds shifted from the previous pass (different flakes each run, which itself confirms flakiness). All current reds are unrelated:

  1. Stateless tests (amd_debug, distributed plan, s3 storage, parallel) → 02676_optimize_old_parts_replicated (result differs with reference): known flake #107506 (linked in the CI report).
  2. Integration tests (amd_msan, 6/8) → test_storage_rabbitmq/test.py::test_rabbitmq_mv_combo (Time limit of 180 seconds reached): master-wide RabbitMQ timing flake — 8 failures across 8 distinct PRs in the last 30 days (CIDB, base_ref master). A documentation-only change cannot affect RabbitMQ message-delivery timing.
  3. Stress test (amd_tsan) + Stress test (arm_asan_ubsan) + Stress test (arm_tsan) → Hung check failed, possible deadlock found: known #107941.

CH Inc sync (tests failed): sync PR ClickHouse/clickhouse-private#62263 is MERGEABLE (no conflict) and builds cleanly — only test jobs failed, in the same flaky categories (the two amd_tsan stress jobs were auto-matched by the harness to Hung check ... possible deadlock found, issue #107941; the stateless/integration failures are the private-config equivalents of the public flakes). Reran the failed sync jobs.

Re-ran the failed flaky jobs on both the public and the private (sync) workflows to try to flip CI green. No master re-merge: merge-base f442bc039c2 is from 06-29 17:58Z (< 1 day fresh) and none of the reds are fixable by merging master. Ready to merge once the flakes clear.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

Re-merged `master` (`52b6ebcd9de`). The PR head had drifted ~776 commits / ~2 days behind and was red only on a stress flake, so I merged master to get fresh CI on a fresh binary. Notably, master had since evolved two files this PR touches — `FunctionDictGetKeys.cpp` and `hasAnyAllTokens.cpp` — and both merged cleanly; the net diff remains doc-string-only (self-contained setup preserved, and the new log array-column example in hasAnyTokens now also carries its own CREATE TABLE/INSERT).

The only public red on the previous head was Stress test (arm_tsan) → Hung check failed, possible deadlock found, which is the chronic master-wide TSan hung-check flake tracked in #107941 (generic PipelineExecutor/thread-pool teardown stacks, no path touched by a documentation-only change). Earlier reruns already cleared the other transient reds (02676_optimize_old_parts_replicated, test_rabbitmq_mv_combo).

AI Review is ✅ Approve on the previous head, and @dhtclk previously approved. Fresh CI is running on the new head and the CH Inc sync PR will regenerate accordingly.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

Continuation re-check (head 52b6ebcd9de, no new commit)

The fresh CI on the re-merged head has come back essentially clean. Status: MERGEABLE / BLOCKED · AI Review ✅ Approve (re-run 03:52Z on this merged head) · @dhtclk APPROVED · 0 actionable unresolved threads (the 3 remaining are isOutdated self-notes already addressed in facdf541968).

The single public red is unrelated to this PR:

CH Inc sync (private #62263) is pending, regenerating on the new head — not a failure. A few Performance Comparison and SQLLogic jobs are still in progress.

The failed arm_binary job cannot be rerun while its parent run is still in progress; it will clear on a rerun once the run completes, or automatically once #108854 merges (which removes this flake master-wide). No code changes needed this pass.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

@groeneai, fix 00171_grouping_aggregated_transform_bug

@groeneai

groeneai commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

@alexey-milovidov Confirmed: 00171_grouping_aggregated_transform_bug here is the same UNEXPECTED_PACKET_FROM_SERVER desync (Code: 102 ... 127.0.0.2:9000 expected TablesStatusResponse, got ProfileInfo: While executing Remote), the fresh master-wide regression from b681776 (#108630) we flagged earlier on this PR for 04093_msan_fiber_distributed_false_positive. Fixing PR is #108854 (yours). Nothing in this docs-only diff can produce a distributed-protocol desync, and reruns pass (46/46).

New signal that helps land the fix: #108854 is now approved (by Algunenano) and MERGEABLE. Its only failing check is one transient AST fuzzer (arm_asan_ubsan) red, STID 2409-5283 ("Cannot find input column ... on its position in inputs of expression actions DAG"), an unrelated analyzer/JOIN fuzz flake (7 hits across 7 distinct PRs, 0 master, 1 hit each in 30d) with no overlap to the Connection/RemoteQueryExecutor/ConnectionEstablisher diff. A rerun of that one job should flip it green so #108854 can land, which removes this desync (00171, 04093, and the rest of the family) master-wide.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

Continuation triage (head 52b6ebcd9de, no new commit)

Status: MERGEABLE / BLOCKED · AI Review ✅ Approve (re-verified 06:34Z on this head, "No minimum required actions", no new findings) · @dhtclk APPROVED · 0 actionable unresolved threads (the 3 remaining are isOutdated self-notes already addressed in facdf541968).

The sole public red is the aggregate Mergeable Check / PR gate, which is red only because of one flaky sub-job: Stateless tests (arm_binary, parallel) → 00171_grouping_aggregated_transform_bug failing with UNEXPECTED_PACKET_FROM_SERVER (expected TablesStatusResponse, got ProfileInfo). This is the well-known distributed connection-desync flake (network layer: Connection::getTablesStatus / ConnectionEstablisher), fixed by the still-open #108854. The CI's own flaky-check already reran the test 46/46 green ("not reproducible"). It cannot be caused by a docs-only diff that only touches FunctionDocumentation / Documentation example strings.

The parent run had now completed, so I re-ran the failed arm_binary job (gh run rerun --failed); it is in progress and should clear the gate.

CH Inc sync is pending (private sync PR #62263 regenerating on this head; not failed → no /fix-sync needed).

No code changes needed this pass. Blocked on: flake rerun going green (or #108854 landing) + new sync completing + your merge.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

Continuation (head 52b6ebcd9de, no new commit)

The one public red on this head — Stateless tests (arm_binary, parallel) in run 28490749368 — completed at 16:21Z failing only on 03381_remote_constants:

Unexpected packet from server 127.0.0.2:9000 (expected TablesStatusResponse, got ProfileInfo) (UNEXPECTED_PACKET_FROM_SERVER)

This is the master-wide distributed-desync race (regression from #108630 b681776), whose fix is your open #108854 — not yet in master, so it keeps rotating across random remote(...) tests (00171, 04093, now 03381). It cannot originate in this PR: the diff is confined to FunctionDocumentation/Documentation example strings — no executable code, no test files.

Since that run had finished (no longer in-flight), I re-ran just the failed shard (gh run rerun 28490749368 --failed) to give the Mergeable Check gate a chance to go green. Everything else is ✅ · AI Review ✅ Approve · @dhtclk approved · 0 actionable unresolved threads (the 3 remaining are isOutdated self-notes already addressed in facdf541968). MERGEABLE / BLOCKED on the flaky gate + your merge.

@clickhouse-gh

clickhouse-gh Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.50% 85.40% -0.10%
Functions 92.70% 92.60% -0.10%
Branches 77.70% 77.60% -0.10%

Changed lines: Changed C/C++ lines covered: 1318/1318 (100.00%) · Uncovered code

Full report · Diff report

@alexey-milovidov

Copy link
Copy Markdown
Member Author

Continuation re-check (head 52b6ebcd9de, no new commit)

CI has fully settled to green since the previous pass. Status: MERGEABLE / CLEAN · AI Review ✅ Approve (re-verified 14:17Z on this head, "No minimum required actions") · @dhtclk APPROVED · 0 actionable unresolved threads (the 3 remaining are isOutdated self-notes already addressed in facdf541968).

The diff remains doc-string-only (embedded FunctionDocumentation/Documentation example SQL — no executable code, no test files), so nothing here can originate a CI red. No code changes needed — ready to merge.

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jul 1, 2026
Merged via the queue into master with commit 7feb1d3 Jul 1, 2026
512 of 514 checks passed
@alexey-milovidov
alexey-milovidov deleted the docs-fix-embedded-doc-examples branch July 1, 2026 17:44
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 1, 2026
alexey-milovidov added a commit that referenced this pull request Aug 2, 2026
PR #108556 made the SQL examples embedded in `system.documentation`
runnable, but nothing runs them, so they go stale again. Add a runner
that executes every one of them against a server, a CI job that provides
that server, and a known-failures baseline; fix every example the runner
found broken, and regenerate the documented responses that no longer
match what the server prints.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…d-doc-examples

Make SQL examples in embedded documentation runnable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-documentation Documentation PRs for the specific code PR pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants