Skip to content

Move TimeSeries and PromQL settings to the private preview tier and rename them to enable_* - #118124

Merged
nikitamikhaylov merged 14 commits into
masterfrom
timeseries-private-preview-tier
Sep 8, 2026
Merged

nikitamikhaylov merged 14 commits into
masterfrom
timeseries-private-preview-tier

Conversation

@nikitamikhaylov

@nikitamikhaylov nikitamikhaylov commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Related: #113481
Related: #118661

Move the TimeSeries engine, promql dialect and timeSeries* aggregate functions to private preview. Rename the two gates to enable_time_series_table and enable_time_series_aggregate_functions, preserving defaults and all previous names as aliases.

BaseSettings.h accepts an optional second alias to retain both legacy aggregate setting names. Existing tests and configs continue exercising the aliases. The branch includes the one-line duplicate-include fix from the related PR to unblock Build (arm_tidy).

Changelog category (leave one):

  • Improvement

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

The TimeSeries table engine, the PromQL dialect and the timeSeries* aggregate functions are moved from the experimental tier to the private preview tier. Settings allow_experimental_time_series_table and allow_experimental_time_series_aggregate_functions are renamed to enable_time_series_table and enable_time_series_aggregate_functions; the old names remain as aliases.


Workflow [PR]
Sync PR [sync-upstream/pr/118124]

Version info

  • Merged into: 26.9.1.972 (included in 26.9 and later)

@mintlify

mintlify Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
ClickHouse-docs 🟢 Ready View Preview Sep 4, 2026, 3:57 PM

@nikitamikhaylov nikitamikhaylov added the comp-promql PromQL / time-series subsystem: TimeSeries storage engine, PromQL parser, PromQL-to-SQL converter... label Sep 4, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [8722a21]

Summary: ✅


AI Review

Summary

This PR renames the TimeSeries / PromQL gates to enable_*, moves those surfaces to the PRIVATE_PREVIEW tier, and adds a two-alias path for enable_time_series_aggregate_functions. I’m requesting changes because the preview gate is still incomplete on the current head, and the new two-alias settings path still lacks focused regression coverage.

Findings
  • ⚠️ Major — [src/Interpreters/executeQuery.cpp:2323] The renamed gate only protects the raw dialect='promql' parser path. StoragePrometheusQuery::getConfiguration ([src/Storages/StoragePrometheusQuery.cpp:108]), StorageTimeSeriesSelector::getConfiguration ([src/Storages/StorageTimeSeriesSelector.cpp:135]), and the Prometheus HTTP handler ([src/Server/PrometheusRequestHandler.cpp:495]) still resolve the TimeSeries table and build PromQL evaluation without consulting enable_time_series_table. That breaks the contract this PR advertises: a user who already has a TimeSeries table can still run PromQL through prometheusQuery*, timeSeriesSelector, and the HTTP API with enable_time_series_table = 0. The check needs to live in shared setup that runs before these paths resolve the table or expose its metadata. Because PrometheusRequestHandler constructs PrometheusHTTPProtocolAPI before dispatch, a fix only in executePromQLQuery would still leave /series, /metadata, /labels, and /label/.../values ungated.
Tests
  • ⚠️ [src/Core/Settings.cpp:9221] enable_time_series_aggregate_functions is the first user of the new two-alias path in BaseSettings ([src/Core/BaseSettings.h:1504]), but there is still no focused proof that both legacy spellings resolve to the same canonical setting. The current branch does not add a test that sets allow_experimental_time_series_aggregate_functions and allow_experimental_ts_to_grid_aggregate_function and verifies they both map to enable_time_series_aggregate_functions / system.settings.alias_for. Please add that small regression test before merging.
Final Verdict

Status: ⚠️ Request changes

Minimum required actions: enforce enable_time_series_table consistently across every PromQL / Prometheus entrypoint before any TimeSeries table resolution or metadata read, and add a focused regression test for the new two-alias enable_time_series_aggregate_functions setting.

LLVM Coverage Report

Measured on commit 8722a21.

Metric Baseline Current Δ
Lines 88.80% 88.80% +0.00%
Functions 91.80% 91.80% +0.00%
Branches 81.20% 81.10% -0.10%

Changed lines: Changed C/C++ lines covered: 394/410 (96.10%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Sep 4, 2026
@yakov-olkhovskiy yakov-olkhovskiy self-assigned this Sep 4, 2026
nikitamikhaylov added a commit that referenced this pull request Sep 5, 2026
- `enable_time_series_aggregate_functions` description starts with a capital
  letter (`01324_settings_documentation`).
- The `TimeSeries` engine docs and the Prometheus interface page name the
  `enable_time_series_table` setting in inline code instead of linking to an
  anchor that the generated settings pages do not have yet (docs link check).
- `04415_docs_web_ui_mdx_components_stripped` expects the `PrivatePreviewBadge`
  of the `TimeSeries` engine documentation instead of `ExperimentalBadge`.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118124&sha=daefa5b3d4cc9d5c4170729f8c18691cdfcdebde&name_0=PR&name_1=Fast%20test
PR: #118124

Co-Authored-By: Claude Fable 5.1 <[email protected]>
{
if (!settings[Setting::allow_experimental_time_series_table])
throw Exception(ErrorCodes::SUPPORT_IS_DISABLED, "Support for PromQL dialect is disabled (turn on setting 'allow_experimental_time_series_table')");
if (!settings[Setting::enable_time_series_table])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This only renames the gate on the raw dialect=promql path. The same private-preview surface is still reachable through prometheusQuery / prometheusQueryRange (StoragePrometheusQuery::getConfiguration), timeSeriesSelector (StorageTimeSeriesSelector::getConfiguration), and the Prometheus HTTP API (PrometheusHTTPProtocolAPI::executePromQLQuery) without consulting enable_time_series_table.

That breaks the contract this PR is advertising: a user who already has a TimeSeries table can still execute PromQL with enable_time_series_table = 0, just not through this one parser entrypoint. Please move the check into shared TimeSeries/PromQL setup code, or reject those alternate entrypoints explicitly too.

Comment thread src/Core/Settings.cpp
/** timeSeries* aggregate functions (private preview). */ \
DECLARE_WITH_ALIAS(Bool, enable_time_series_aggregate_functions, false, R"(
Enables the `timeSeries*` aggregate functions for Prometheus-like time series resampling, rate, and delta calculation.
)", PRIVATE_PREVIEW, allow_experimental_time_series_aggregate_functions, allow_experimental_ts_to_grid_aggregate_function) \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is the first use of the new two-alias path, but the renamed time-series tests now exercise only enable_time_series_aggregate_functions. That leaves no focused proof that both legacy spellings still resolve to the same setting; the existing alias tests only cover the one-alias case.

Please add a small regression test that sets allow_experimental_time_series_aggregate_functions and allow_experimental_ts_to_grid_aggregate_function and verifies they both update enable_time_series_aggregate_functions / system.settings.alias_for.

Comment thread tests/server.pid Resolved
nikitamikhaylov added a commit that referenced this pull request Sep 5, 2026
…w_feature_tier`

The test used `allow_experimental_time_series_table` as its example of an
experimental setting. That setting is in the private preview tier now, so
`allow_feature_tier = 1` no longer rejects it. Use
`allow_experimental_funnel_functions` instead, as the test itself asks when
an example setting changes tier.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118124&sha=81fa223449b9f871afd301c197c1c179246ef9f4&name_0=PR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20flaky%29
PR: #118124

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@zlareb1

zlareb1 commented Sep 5, 2026

Copy link
Copy Markdown
Member

A stray test-run artifact slipped into this PR: tests/server.pid (content 3520550, present at head 628f70b). Worth dropping before merge. The settings changes themselves look consistent — all SettingsChangesHistory.cpp entries are value no-ops in the 26.9 block, and both legacy allow_experimental_* names are kept as aliases.

@clickhouse-gh

clickhouse-gh Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 8722a2171 with master bd4f0881a (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

14 translation units recompiled, 81 s compile time in total, 14 of them have a recent master baseline.

Job report

nikitamikhaylov and others added 7 commits September 7, 2026 10:59
The settings `allow_experimental_time_series_table`,
`time_series_prefer_recent_samples_table`,
`allow_experimental_time_series_aggregate_functions`, `promql_database`,
`promql_table` and `promql_evaluation_time` (with their aliases) move from
`EXPERIMENTAL` to `PRIVATE_PREVIEW`. Default values do not change.

The `TimeSeries` engine documentation uses `PrivatePreviewBadge` instead of
`ExperimentalBadge`, and the error messages of `StorageTimeSeries` and the
`timeSeries*` aggregate functions no longer call the feature experimental.

Test `03257_setting_tiers` now expects the private preview tier to be
non-empty for `system.settings`, and `03413` no longer needs to exclude
`time_series_prefer_recent_samples_table` from the experimental tier check.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ries_*`

`allow_experimental_time_series_table` becomes `enable_time_series_table` and
`allow_experimental_time_series_aggregate_functions` becomes
`enable_time_series_aggregate_functions`. The old names stay as aliases, as
does the older `allow_experimental_ts_to_grid_aggregate_function`.

`DECLARE_WITH_ALIAS` used to accept a single alias. The alias-map generator
in `BaseSettings.h` now accepts one or two aliases, so a setting renamed
twice keeps both of its previous names.

Code, error messages, built-in documentation, tests, performance tests,
CI configs and the Prometheus interface documentation use the new names.
The old names stay on the `allow_*` style-check ignore list because they
still appear in `Settings.cpp` as aliases.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The Python tests already reference `configs/enable_time_series_table.xml`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
- `enable_time_series_aggregate_functions` description starts with a capital
  letter (`01324_settings_documentation`).
- The `TimeSeries` engine docs and the Prometheus interface page name the
  `enable_time_series_table` setting in inline code instead of linking to an
  anchor that the generated settings pages do not have yet (docs link check).
- `04415_docs_web_ui_mdx_components_stripped` expects the `PrivatePreviewBadge`
  of the `TimeSeries` engine documentation instead of `ExperimentalBadge`.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118124&sha=daefa5b3d4cc9d5c4170729f8c18691cdfcdebde&name_0=PR&name_1=Fast%20test
PR: #118124

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The `TimeSeries` engine is in private preview now, not experimental.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…w_feature_tier`

The test used `allow_experimental_time_series_table` as its example of an
experimental setting. That setting is in the private preview tier now, so
`allow_feature_tier = 1` no longer rejects it. Use
`allow_experimental_funnel_functions` instead, as the test itself asks when
an example setting changes tier.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118124&sha=81fa223449b9f871afd301c197c1c179246ef9f4&name_0=PR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20flaky%29
PR: #118124

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ter`

Tests, a performance test and the documentation strings of the new
`timeSeriesSumToGrid`, `timeSeriesAvgToGrid` and `timeSeriesCountToGrid`
functions were added on `master` with `allow_experimental_time_series_table`
and `allow_experimental_time_series_aggregate_functions`; switch them to
`enable_time_series_table` and `enable_time_series_aggregate_functions`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
nikitamikhaylov and others added 2 commits September 7, 2026 22:33
…s `master`

The performance comparison applies a test's `<settings>` to both the patched and
the reference server, and the reference `master` binary does not know
`enable_time_series_table` and `enable_time_series_aggregate_functions` yet, so
every `TimeSeries`/PromQL performance test failed at the settings stage:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118124&sha=57facab8d0418f0545c61c3fca37048c4124a6c6&name_0=PR&name_1=Performance%20Comparison%20(arm_release%2C%20master_head%2C%201%2F6)

Use the `allow_experimental_time_series_*` aliases there for now, as was done
for the JSON, Variant and Dynamic renames; a follow-up can switch them once
this change is in `master`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The merge of `master` introduced a duplicate include in
`MergeTreeIndexConditionText.cpp`, which fails `readability-duplicate-include`.
Apply the one-line fix already proposed in the related PR so this branch can
run its remaining CI jobs.

Related: #118661
Related: #118124
CI: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118124&sha=bafedbbcc64a7a2e201917484f6abc5961633a02&name_0=PR&name_1=Build%20%28arm_tidy%29
Verify that both earlier aggregate setting names update
`enable_time_series_aggregate_functions`, enable the aggregate functions,
and report the correct `system.settings.alias_for`. Check the table setting
alias and the tier of every promoted setting as well.

Related: #118124
Keep existing tests and config files on the retained setting aliases. They
already exercise both legacy aggregate names, so remove the redundant new
test and the mechanical renames. Record only the two new setting names in
`SettingsChangesHistory` and use `__VA_OPT__` for the optional second alias.

Related: #118124
Use the merged CI account fix so `Build profile diff` can query
`binary_sizes`. The PR diff remains unchanged.

Related: #118618
Related: #118124
@clickhouse-gh

clickhouse-gh Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

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

no significant changes detected. K_source=6 K_base=30 flagged=0/65

clickbench

🟢 No significant changes

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: d0110076-eadd-49da-bc9d-4dd7e04adc6a
  • MIRAI run: 16b520e3-b74b-4d91-ba02-a2d23ccdf39f
  • PR check IDs:
    • clickbench_1638342_1788858993
    • clickbench_1638349_1788858993
    • clickbench_1638355_1788858993
    • tpch_adapted_1_official_1638366_1788858994
    • tpch_adapted_1_official_1638382_1788858993
    • tpch_adapted_1_official_1638413_1788858994

@clickhouse-gh

clickhouse-gh Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

PromQL Compliance Report

Baseline: S3 master bd4f0881a

Metric Baseline Current Δ
Score 81.82% 81.82% +0.00%
Passed 441 441 +0
Failed 3 3 +0
Unsupported 95 95 +0

Note: score is unchanged vs baseline.

Uploaded compliance JSON for this PR commit

@nikitamikhaylov nikitamikhaylov left a comment

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.

LGTM

@nikitamikhaylov
nikitamikhaylov added this pull request to the merge queue Sep 8, 2026
Merged via the queue into master with commit af30b32 Sep 8, 2026
512 of 515 checks passed
@nikitamikhaylov
nikitamikhaylov deleted the timeseries-private-preview-tier branch September 8, 2026 14:26
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 8, 2026
@alexey-milovidov alexey-milovidov mentioned this pull request Sep 9, 2026
1 task done
alexey-milovidov added a commit that referenced this pull request Sep 9, 2026
The master merge brought in the `TimeSeries` private-preview work (#118124), which added
`getASCreateQuery`: because the columns of a `TimeSeries` table are always generated, an `AS <other
table>` source that is not itself a `TimeSeries` table is now rejected with `INCORRECT_QUERY`, and that
happens before the external `SAMPLES`/`TAGS` target is resolved.

`05099_reattach_tables_access` asserts the opposite order - that
`CREATE TABLE ts ENGINE = TimeSeries SAMPLES missing_samples AS src` fails with `UNKNOWN_TABLE` on the
missing target - so with a `MergeTree` source the statement now stops one step earlier and the check
reported `FAIL (unexpected error: ... Cannot CREATE a TimeSeries table AS ... because it is not a
TimeSeries table)`.

Make the source a `TimeSeries` table. The `AS` clause then passes and the statement fails on the missing
target again, so the check keeps testing what it is for: the target is resolved before any source table is
read, and the source must not be detached on the way. Verified against a server built from this branch -
the statement returns `TimeSeries: Target table ... doesn't exist. (UNKNOWN_TABLE)` and the trace carries
no `DETACH TABLE` for the source.

Also switch the three uses to `enable_time_series_table`, the name the setting was renamed to;
`allow_experimental_time_series_table` still works, but only as an alias.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-promql PromQL / time-series subsystem: TimeSeries storage engine, PromQL parser, PromQL-to-SQL converter... pr-improvement Pull request with some product improvements 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