Skip to content

Rename setting allow_experimental_trino_dialect to enable_trino_dialect - #120007

Merged
fm4v merged 2 commits into
ClickHouse:masterfrom
groeneai:groeneai/rename-trino-dialect-setting
Sep 15, 2026
Merged

fm4v merged 2 commits into
ClickHouse:masterfrom
groeneai:groeneai/rename-trino-dialect-setting

Conversation

@groeneai

@groeneai groeneai commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #115383
Related: #113480

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Description

@ fm4v asked for this rename on #115383, which added the setting.

allow_experimental_trino_dialect becomes enable_trino_dialect, following #113480, where the
sibling dialect gate allow_experimental_json_ast_dialect was renamed for the reasons given there.
The tier stays EXPERIMENTAL and the default stays false; only the name changes.

Plain rename, no alias, because no released version carries the old name: src/Core/Settings.cpp
on the 26.8, 26.7 and 26.6 branches contains it 0 times, and its history record sits in the
unreleased 26.9 block, renamed in place there.

The enableAllExperimentalSettings.cpp entry is deleted rather than renamed. That helper allows
experimental features that can be used in a CREATE query when recoverLostReplica() re-creates
tables from stored metadata; a session-level dialect gate is not one, which is why the kusto,
prql and polyglot gates are exceptions there rather than entries. Trino was the only one
entered, by 0f8a47380ad509 ("Fix Trino dialect CI failures"), to answer the allow_*
registration check in check_cpp.sh. No experimental_settings_ignore.txt entry replaces it: I
ran that check's predicate on this tree and it is empty, and an unused entry reds it too.

One consequence to flag: anyone already setting the old name on master or nightly gets
UNKNOWN_SETTING. Nothing released breaks, but I can use DECLARE_WITH_ALIAS to keep the old
name working instead. Your call.

This PR adds no check forbidding new allow_experimental_* canonical names. 24 such names remain
after it, so a check needs a 24-entry grandfather list, and whether those get renamed or
grandfathered is a maintainer's decision rather than something to settle inside a one-setting
rename. I have asked that question on #115383.

05020_trino_dialect_errors also gains coverage for the clickhouse-local input() reparse path,
which reads the gate captured at parse time, and for the gate message naming the setting.

Autogenerated settings pages are left to the nightly docs job (ci/jobs/docs_autogen_nightly.py).


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

Version info

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

groeneai and others added 2 commits September 14, 2026 13:26
Requested by @fm4v on ClickHouse#115383, which added the setting.

The `allow_experimental_` prefix is the pre-tier way of gating a feature. The `EXPERIMENTAL`
tier in the declaration already carries that information and is exposed as `tier` in
`system.settings`, so the prefix duplicates it in the one place that is expensive to change
later, the name. This follows ClickHouse#113480, which renamed the sibling dialect gate
`allow_experimental_json_ast_dialect` to `enable_json_ast_dialect`.

Plain rename with no alias, because no released version carries the old name:
`src/Core/Settings.cpp` on the 26.8, 26.7 and 26.6 branches contains it 0 times, the newest
stable tag is v26.8.3.105-lts, and its history record is in the unreleased 26.9 block. The
record is therefore renamed in place rather than a second one being added: an in-place rename
keeps the value signature and reason text identical, which is what makes
`parse_settings_history_changes` recognize it as a rename and report it under the new name
only, and what keeps `03999_stateless_settings_history` from seeing a record naming a setting
that no longer exists. Users on master or nightly who already set the old name will get
UNKNOWN_SETTING.

The `enableAllExperimentalSettings` entry is deleted rather than renamed. That helper enables
experimental features that can be used in a CREATE query, so that
`DatabaseReplicated::recoverLostReplica` can re-create tables from stored metadata; `dialect`
is a session setting governing how query text is parsed and cannot appear in a CREATE query,
which is why the kusto, prql and polyglot gates are entries in
`experimental_settings_ignore.txt` instead. Trino was the only one registered in the helper,
added by 0f8a473 ("Fix Trino dialect CI failures") to satisfy the `allow_*`
registration check in check_cpp.sh rather than to fix a recovery failure. No ignore-list entry
replaces it: that check compares `allow_*` tokens only, and the renamed setting no longer has
such a token, so an entry would be unused and would fail the same check.

The autogenerated settings documentation is left to the nightly docs job, which regenerates it
from `src/Core/Settings.cpp`.

Co-Authored-By: Claude Opus 5 <[email protected]>
Two renamed sites in `LocalConnection` were reached by no test: the parser-affecting settings
captured at parse time and the `input()` initializer that reparses the original query with them.
Every other trino test drives `clickhouse-client`, so `LocalConnection` is never entered. The
invariant is that a query accepted with the gate on keeps being reparsed with the gate on, even
when the query's own `SETTINGS` clause turns it off during execution; reading the live value there
would fail an otherwise valid query with SUPPORT_IS_DISABLED from inside the initializer. The
sibling `clickhouse_json` gate already has this coverage in
04349_ast_json_local_input_dialect_boundary, whose shape the two new arms follow. The second arm
runs the same query without the gate, so the first arm cannot pass for an unrelated reason.

The gate message tells the user which setting to turn on and nothing asserted its text; the
existing assertion greps the error code only. The new assertion greps the setting name rather than
the sentence, since the prose can be reworded while the name is the contract.

Co-Authored-By: Claude Opus 5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai labels Sep 14, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (2 cold reviews, 1 fix round, 2 findings adjudicated)

An independent model reviewed this change cold, without the author's evidence; a fix round followed;
a second cold review and a second gate pass over the resulting tree found nothing further. Every
finding is listed with its verdict.

# Severity Finding Verdict
❌ 1 major The two renamed lines in LocalConnection (the parse-time gate capture and the input() initializer's Trino branch) were reached by no test: every test in the trino family runs through clickhouse-client, so clickhouse-local was never entered. The clickhouse_json gate has exactly this coverage in 04349_ast_json_local_input_dialect_boundary.sh. AGREE, fixed: two arms appended to 05020_trino_dialect_errors.sh, one accepting a query with a query-local SETTINGS enable_trino_dialect = 0 through input() (the gate captured at parse time must survive it), one gate-off control proving the first is gate-keyed. Verified live rather than assumed: making the initializer read the live gate instead of the captured one turns that arm red and the whole test to 1 error; unmutated, 50/50 with randomization on.
⚠️ 2 nit The gate message that tells the user which setting to turn on named the setting, and no test asserted that text, so a half-done rename of the literal would have stayed green. AGREE, folded into the same round: the existing gate-off assertion now also greps the setting name, and only the name, so the wording stays free to change.

Also checked and clear: rename completeness (0 occurrences of the old name outside autogenerated
settings pages, which the nightly docs job regenerates - proven by the already-renamed siblings,
which appear in those same pages under their new names although neither rename commit touched them);
the plain-rename-versus-alias decision (the old name appears 0 times in src/Core/Settings.cpp on
26.8, 26.7 and 26.6, each fetch carrying a positive control, and there is no 26.9 branch);
the history record renamed in place in the current unreleased block, which ci/jobs/check_style.py
documents as the supported shape, with neither name present in the frozen 03999 baseline; the
enableAllExperimentalSettings deletion (all three callers of that helper parse nothing through the
dialect dispatch, and every dispatch is && !internal anyway; comm -3 in check_cpp.sh is
symmetric, so leaving the entry would red the check, and removing it leaves Trino in the same state
#113480 left the sibling gate in); the allow_* predicate itself, re-run here with a positive
control so the pass is not vacuous; and that CHANGELOG.md carries nothing to update.

Also noticed, not raised: _SETTINGS_ALIAS_RE in ci/jobs/check_style.py recognises only the first
alias of a two-alias declaration. Pre-existing, not reached by this change, no user-visible
consequence.

@clickhouse-gh

clickhouse-gh Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [312fd26]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) ERROR
LLVM Coverage DROPPED

AI Review

Summary

This PR renames the Trino dialect gate from allow_experimental_trino_dialect to enable_trino_dialect, updates the parser entrypoints and user-facing message, removes the old enableAllExperimentalSettings special case, and refreshes the Trino tests accordingly. I did not find a current correctness, compatibility, or documentation-source issue in the live patch: the rename is complete in the non-generated tree, the clickhouse-local input() reparse path is covered, and the remaining old-name references are autogenerated docs outputs derived from Settings.cpp.

Final Verdict

✅ No blocking or major issues found in the current PR state.

@groeneai
groeneai requested review from fm4v and vitlibar September 14, 2026 15:52
@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Sep 14, 2026
@fm4v fm4v self-assigned this Sep 14, 2026
@fm4v
fm4v enabled auto-merge September 14, 2026 16:03
@clickhouse-gh clickhouse-gh Bot added the comp-sql-syntax SQL/grammar parsing, AST nodes, syntax-level features. label Sep 14, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 312fd266d with master de1224b14 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 28fd75867; 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

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

Job report

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 312fd26

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) / no failing test at-cap job kill, not a test failure. The job ran 9055.47 s against the 9000 s budget (step 19:07:21Z to 21:38:21Z), reported through test 13497 of 14074, and died with ZERO failing leaves: CIDB holds no FAIL/ERROR row for this pull request on any check, and the praktika report's single failure entry is the JOB row itself. The ordinary functional path passes global_time_limit=0, so there is no graceful stop and the watchdog SIGTERMs the process group, which is why the red is unattributable. Signature-scoped census over 30 days: 52 rows on this check with check_status = 'error' and an empty test_name, spread over 49 distinct pull requests, plus 4 true-master rows #116209 (mine, open)
Mergeable Check, PR praktika rollups of the row above, no independent leaf failure #116209 (mine, open)

#116209 is the causal owner, not a same-area coincidence: it splits this exact lane into
parallel, 1/2 and parallel, 2/2 because it reaches the 9000 s cap, and its description
already measures the population this run belongs to (43 at-cap runs in 90 days, 30 reported as
error, 18 of them on ParallelReplicas). It is still open and carries manual approve, so the
lane keeps timing out until it lands.

Not reachable from this diff: the change renames one setting, allow_experimental_trino_dialect
to enable_trino_dialect (24 files, +43/-28, token renames plus one deleted line in
enableAllExperimentalSettings.cpp). It adds no test, no query and no work to any lane, so it
cannot move a coverage shard's runtime; the same shard reached the cap on 49 other pull requests
in the last 30 days. Everything else on this head is green: 176 unique check-runs with 0
incomplete, Finish Workflow OK, Style check OK and CH Inc sync OK.

Session id: cron:our-pr-ci-monitor:20260914-220033

@fm4v
fm4v added this pull request to the merge queue Sep 15, 2026
Merged via the queue into ClickHouse:master with commit 4f217e7 Sep 15, 2026
175 of 349 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-sql-syntax SQL/grammar parsing, AST nodes, syntax-level features. groeneai-origin-request PR origin: a maintainer pinged or directed groeneai pr-not-for-changelog This PR should not be mentioned in the changelog 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.

3 participants