Skip to content

Fix spurious ILLEGAL_COLUMN in ALTER TABLE ADD COLUMN IF NOT EXISTS - #110080

Merged
tuanpach merged 9 commits into
ClickHouse:masterfrom
groeneai:fix-add-column-if-not-exists-illegal-column
Jul 30, 2026
Merged

tuanpach merged 9 commits into
ClickHouse:masterfrom
groeneai:fix-add-column-if-not-exists-illegal-column

Conversation

@groeneai

@groeneai groeneai commented Jul 11, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

Fixed a spurious ILLEGAL_COLUMN error from ALTER TABLE ... ADD COLUMN IF NOT EXISTS when the column already exists at apply time. This happened when the same column was added twice with IF NOT EXISTS in one statement, or when a concurrent ALTER added the column between the prepare and apply phases.

Description

ADD COLUMN IF NOT EXISTS is resolved in AlterCommands::prepare against the prepare-time metadata snapshot: command.ignore is set only when the column already exists in that snapshot. But checkAlterIsPossible re-applies the commands through AlterCommand::apply against a fresher snapshot, and the ADD_COLUMN branch of AlterCommand::apply unconditionally called metadata.columns.add(), which throws ILLEGAL_COLUMN (ColumnsDescription::add) when the column now exists.

ADD_COLUMN was the only ADD_*/column operation whose apply() ignored its if_[not_]exists flag. DROP/MODIFY/COMMENT_COLUMN honor it via an early return, and ADD_INDEX/ADD_CONSTRAINT/ADD_PROJECTION all honor if_not_exists at apply time; validate() also already tolerates a pre-existing column. So apply() was inconsistent with both validate() and its siblings.

Two triggers hit the same missing guard:

  • two ADD COLUMN IF NOT EXISTS <same col> in one statement — prepare marks neither ignore; validate adds the column for the first command then continues the second; apply adds the first then throws on the second;
  • a concurrent ALTER adds the column between prepare and apply on a ReplicatedMergeTree.

Deterministic repro:

CREATE TABLE t (id UInt64) ENGINE = MergeTree ORDER BY id;
ALTER TABLE t ADD COLUMN IF NOT EXISTS extra String, ADD COLUMN IF NOT EXISTS extra String;
-- before: Code: 44. ILLEGAL_COLUMN: Cannot add column extra: column with this name already exists.
-- after:  no-op success, column added once

The fix skips the add in apply() when if_not_exists is set and the column already exists, matching ColumnsDescription::add's own existence check. Plain ADD COLUMN of an existing column still throws DUPLICATE_COLUMN, so duplicate detection is untouched. Test 01318_alter_add_column_exists previously codified the buggy behavior (asserted serverError ILLEGAL_COLUMN); it is updated to assert the corrected behavior plus positive/negative cases.

No related open issue found (searched ClickHouse/ClickHouse issues and PRs).

Version info

  • Merged into: 26.8.1.427 (included in 26.8 and later)

ADD COLUMN IF NOT EXISTS is resolved in AlterCommands::prepare against the
prepare-time metadata snapshot (command.ignore is set only if the column
already exists then). But checkAlterIsPossible re-applies the commands via
AlterCommand::apply against a fresher snapshot, and AlterCommand::apply for
ADD_COLUMN unconditionally called metadata.columns.add(), which throws
ILLEGAL_COLUMN when the column now exists. This is the only ADD_*/column op
whose apply() ignored its if_not_exists flag (DROP/MODIFY/COMMENT_COLUMN,
ADD_INDEX/CONSTRAINT/PROJECTION all honor it).

Two triggers hit it: (a) two ADD COLUMN IF NOT EXISTS of the same column in
one statement (prepare marks neither ignore; validate adds it once then
continues), and (b) a concurrent ALTER adds the column between prepare and
apply on a ReplicatedMergeTree.

Skip the add in apply() when if_not_exists is set and the column already
exists, matching ColumnsDescription::add's own existence check. Plain ADD
COLUMN still throws DUPLICATE_COLUMN on an existing column.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. CREATE TABLE t (id UInt64) ENGINE=MergeTree ORDER BY id; ALTER TABLE t ADD COLUMN IF NOT EXISTS extra String, ADD COLUMN IF NOT EXISTS extra String; throws Code: 44 ILLEGAL_COLUMN on master every time.
b Root cause explained? prepare() sets command.ignore for ADD COLUMN IF NOT EXISTS only when the column exists in the prepare-time snapshot; checkAlterIsPossible re-applies commands via AlterCommand::apply against a fresher snapshot; the ADD_COLUMN branch called metadata.columns.add() unconditionally → ColumnsDescription::add throws ILLEGAL_COLUMN. Two-INE-same-col in one statement leaves neither command ignored; a concurrent ALTER adds the column between prepare and apply.
c Fix matches root cause? Yes. Adds if (if_not_exists && metadata.columns.has(column_name)) return; at the top of the ADD_COLUMN branch in AlterCommand::apply, matching the existence check ColumnsDescription::add itself uses, and matching how DROP/MODIFY/COMMENT_COLUMN and ADD_INDEX/CONSTRAINT/PROJECTION already honor their if_[not_]exists flag at apply time.
d Test intent preserved / new tests added? Yes. 01318_alter_add_column_exists previously asserted serverError ILLEGAL_COLUMN (codified the bug). Updated to assert the corrected no-op success, plus a positive case (two INE of a new column → added once) and negative cases (plain ADD COLUMN of an existing column, and two plain ADD COLUMN of the same new column → still DUPLICATE_COLUMN).
e Both directions demonstrated? Yes. Baseline binary (Build ID 4020f430…): repro throws code 44. Fixed binary (Build ID 8a6b6826…): repro succeeds, plain-ADD duplicate still throws code 15.
f Fix is general across code paths? Yes. AlterCommand::apply ADD_COLUMN is the single apply-time entry for column additions; both single-statement and concurrent-ALTER triggers route through it. Sibling ops already had the guard; this makes ADD_COLUMN symmetric.
g Fix generalizes across inputs? Yes. Guard keys only on if_not_exists + column-name existence, so it is type-agnostic; verified with plain, Nullable, and LowCardinality-wrapped columns — INE add of a new column still adds it, INE add of an existing one is a no-op.
h Backward compatible? Yes. No setting/format change. Only removes a spurious error for IF NOT EXISTS, which per SQL semantics should be a no-op; plain ADD COLUMN duplicate detection (DUPLICATE_COLUMN) is unchanged.
i Invariants and contracts preserved? Yes. metadata.columns invariant (no duplicate column names) is upheld — the guard returns exactly when ColumnsDescription::add would have thrown on a duplicate, so no duplicate is ever inserted. The ignore-path contract in the plural AlterCommands::apply loop is unaffected.

Session id: cron:clickhouse-worker-slot-1:20260711-062400

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @tavplubix @alesapin — could you review this? AlterCommand::apply for ADD_COLUMN ignored its if_not_exists flag and unconditionally called ColumnsDescription::add, so ADD COLUMN IF NOT EXISTS spuriously threw ILLEGAL_COLUMN when the column already existed at apply time (two INE of the same column in one statement, or a concurrent ALTER between prepare and apply). The one-line guard makes it symmetric with DROP/MODIFY/COMMENT_COLUMN and ADD_INDEX/CONSTRAINT/PROJECTION, which already honor if_[not_]exists at apply time.

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Jul 11, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [23d0027]

Summary: ✅


AI Review

Summary

This PR fixes ALTER TABLE ... ADD COLUMN IF NOT EXISTS so the apply-time replay matches prepare() / validate() for duplicate adds, nested columns, and the share_nested_offsets = 0 mutation-planning path. I rechecked the current head against every prior discussion thread and did not find a remaining correctness issue: the shared columnsAddedByAlter helper keeps apply() and validate() aligned, the share_nested_offsets flag is threaded through both metadata-apply and mutation-planning replays, and the expanded stateless coverage exercises the regressions that were previously reported.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Jul 11, 2026
Comment thread src/Storages/AlterCommands.cpp Resolved
flatten_nested (default on) stores n Nested(a ...) as n.a, so the
apply-time has(column_name) guard is false for the nested group name
and the flattened n.a add still throws ILLEGAL_COLUMN when the same
nested group is added twice with IF NOT EXISTS in one statement. Guard
with has() || hasNested() so IF NOT EXISTS is a consistent no-op for
nested adds too. The collision is independent of share_nested_offsets,
so the check is unconditional.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

Good catch. Fixed in 616950c: the apply-time guard now checks has(column_name) || hasNested(column_name), so ADD COLUMN IF NOT EXISTS n Nested(...) added twice in one statement is a no-op instead of throwing ILLEGAL_COLUMN on the flattened n.a add.

On threading share_nested_offsets into apply(): the flattened-n.a collision happens regardless of share_nested_offsets (I confirmed share_nested_offsets = 0 still throws), so the guard is unconditional rather than mirroring prepare()'s share_nested_offsets && hasNested(...). Gating it on the setting would leave the share_nested_offsets = 0 case broken, and threading the flag through the 7 apply() call sites is unnecessary for correctness here.

Regression test 01318_alter_add_column_exists extended with the nested matrix: double IF NOT EXISTS nested add (default settings), multi-field nested group, and share_nested_offsets = 0.

Pre-PR validation gate (click to expand)
# Check Result
a Deterministic repro? Yes: CREATE TABLE t (id UInt64) ENGINE=MergeTree ORDER BY id; ALTER TABLE t ADD COLUMN IF NOT EXISTS n Nested(a UInt32), ADD COLUMN IF NOT EXISTS n Nested(a UInt32); throws ILLEGAL_COLUMN (Cannot add column n.a) every time on the pre-fix binary.
b Root cause explained? flatten_nested (default on) stores n Nested(a ...) as n.a. prepare() leaves both IF NOT EXISTS commands non-ignored; validate() adds n.a for cmd 1 and continues cmd 2 via its nested-aware `has()
c Fix matches root cause? Yes: apply-time guard extended to has(column_name) || hasNested(column_name), matching validate()'s existence predicate, so the flattened add is skipped when the nested group already exists.
d Test intent preserved / new tests added? Yes: no assertion weakened. Nested cases appended to 01318_alter_add_column_exists; plain ADD COLUMN (no IF NOT EXISTS) of an existing column/nested group still asserts DUPLICATE_COLUMN.
e Demonstrated both directions? Yes: test FAILS on the baseline (has()-only guard, build 753fe84) and PASSES with the fix (build 91a1e47), via clickhouse-test.
f Fix general, not a narrow patch? Yes: hasNested covers single- and multi-field nested groups; verified for flatten_nested 0/1 and share_nested_offsets 0/1. Sibling ADD ops already honor if_not_exists at apply time.
g Generalizes across inputs? Verified matrix: scalar double-INE, nested single/multi-field double-INE, share_nested_offsets 0/1, INE add of an already-existing nested group, and INE add of a differently-shaped nested group under the same name (all no-op); plain double-add still DUPLICATE_COLUMN.
h Backward compatible? Yes: no setting, format, or default change. Only removes a spurious error path; IF NOT EXISTS semantics are unchanged, plain-add duplicate detection unchanged.
i Invariants preserved? Yes: skipping the add early is exactly what ColumnsDescription::add's own existence check enforces; no metadata structure invariant touched (the early return runs before columns.add()/addImplicitIndicesForColumn).

Session id: cron:clickhouse-worker-slot-4:20260711-122100

Comment thread src/Storages/AlterCommands.cpp Resolved
The previous guard used has(column_name) || hasNested(column_name). The
hasNested() prefix match is broader than prepare()/validate(): a table with
only n.a would wrongly skip a genuinely new, distinct top-level scalar n
(ADD COLUMN IF NOT EXISTS n String silently dropped).

Instead compute the exact set of column names this ADD would insert (the
flattened n.a, n.b, ... under flatten_nested, or the single column) and skip
only names that truly already exist. This keeps the double-add nested no-op
correct while not dropping a real new column, and is consistent regardless of
share_nested_offsets.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

Good catch, and agreed. Fixed in 2aa3b7f by switching the apply-time guard to your second suggestion: compare the exact transformed names that would be inserted rather than an n.* prefix.

AlterCommand::apply now computes the concrete set of columns the ADD would insert (the flattened n.a, n.b, ... under flatten_nested, or the single column otherwise) and, for IF NOT EXISTS, drops from that set only names where metadata.columns.has(name) is true. It adds whatever remains and skips only when the set becomes empty.

Why not gate on share_nested_offsets in apply(): the original double-add collision is at the flattened name level and reproduces independently of share_nested_offsets (confirmed with share_nested_offsets = 0 too), because apply() runs on a snapshot that already contains the first add's n.a. Threading the setting through the 7 apply() call sites would only recreate the prefix-equivalence question; comparing exact inserted names is both narrower and consistent with prepare()/validate() for every value of share_nested_offsets.

Regression (01318_alter_add_column_exists) now covers the false-negative you described: a table with only n.a (share_nested_offsets = 0) plus ADD COLUMN IF NOT EXISTS n String must still add the distinct top-level n. Verified both directions via clickhouse-test / clickhouse-local: the pre-fix binary (has() || hasNested(), Build ID 91a1e47) drops n; the fixed binary (Build ID 1117596) adds it. The original double-INE-nested no-op cases (both share_nested_offsets values) still pass.

Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. CREATE TABLE t (key UInt64, \n.a` UInt32) ENGINE=MergeTree ORDER BY key SETTINGS share_nested_offsets=0; ALTER TABLE t ADD COLUMN IF NOT EXISTS n String;— pre-fix silently dropsn`.
b Root cause explained? apply()'s guard used hasNested(column_name), an unconditional n.* prefix match. When only n.a exists, hasNested("n") is true, so a genuinely new distinct scalar n is skipped — broader than prepare()/validate(), which prefix-match only when share_nested_offsets is on.
c Fix matches root cause? Yes. Replaced the prefix match with an exact-transformed-name comparison: skip a name only when metadata.columns.has(name) is true.
d Test intent preserved / new tests added? Yes. Added the false-negative case to 01318; kept the double-INE-nested no-op cases (both share_nested_offsets values).
e Both directions demonstrated? Yes. Pre-fix (Build ID 91a1e47) drops n; fix (Build ID 1117596) adds it; full 01318 reference matches only with the fix.
f Fix is general across code paths? Yes. Single apply-time ADD_COLUMN path; the flatten/no-flatten branches now share one insertion loop over the exact name set.
g Fix generalizes across inputs? Yes. Matrix covered: flatten_nested 0/1 × {nothing exists, only n.a exists, n exists} × {double-add-in-one-statement, single add}; single-field and multi-field Nested; share_nested_offsets 0/1.
h Backward compatible? Yes. No setting/format change; strictly narrows an over-broad skip so IF NOT EXISTS no longer drops a valid column.
i Invariants and contracts preserved? Yes. Insertion order preserved (reverse iteration for after/first); addImplicitIndicesForColumn still called for the requested column; guard now matches validate()'s existence semantics.

Session id: cron:clickhouse-worker-slot-0:20260711-133400

Comment thread src/Storages/AlterCommands.cpp Resolved
The apply-time IF NOT EXISTS existence check must match prepare()/validate(),
which gate n/n.* equivalence on share_nested_offsets. With it enabled (default),
any pre-existing n.* makes the whole nested/scalar add a no-op (via hasNested);
with it disabled n and n.* are independent, so only exact transformed names that
already exist are skipped. This keeps ADD COLUMN n.a, ADD COLUMN IF NOT EXISTS
n Nested(a, b) consistent between validate() and apply() (no spurious n.b) while
still adding a genuinely new distinct column under share_nested_offsets = 0.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

Addressed in 1fe36fb. Root of the tension: finding #2 correctly required not treating any n.* prefix as "exists" (a distinct top-level n must still be added under share_nested_offsets = 0), but the exact-name filter then diverged from prepare()/validate() under the default share_nested_offsets = 1, where they treat any pre-existing n.* as "the whole nested column already exists".

Fix: thread share_nested_offsets into AlterCommand::apply (and AlterCommands::apply), mirroring prepare()/validate(). The MergeTree call sites (StorageMergeTree, StorageReplicatedMergeTree, MergeTreeData::checkAlterIsPossible) pass their share_nested_offsets setting; non-MergeTree callers keep the default true.

  • share_nested_offsets = 1 (default): if_not_exists && (has(n) || hasNested(n)) → the whole command is a no-op, exactly as validate() does. So ADD COLUMN \n.a`, ADD COLUMN IF NOT EXISTS n Nested(a, b)adds onlyn.a; n.b` is not inserted (apply no longer diverges from validate).
  • share_nested_offsets = 0: n and n.* are independent, so the exact transformed-name compare (finding Repair subtree2 #2) applies — skip only names that truly exist, add the rest.

Matrix verified (share_nested_offsets {0,1} × {n exists / only n.a exists / nothing exists} × {double-INE nested, ADD n.a then ADD IF NOT EXISTS n Nested}):

case sno before statement result
A (finding #3) 1 — ADD n.a, ADD IF NOT EXISTS n Nested(a,b) only n.a (whole no-op, matches validate)
B (finding #2) 0 n.a ADD IF NOT EXISTS n String adds distinct top-level n
C 0 — ADD n.a, ADD IF NOT EXISTS n Nested(a,b) n.a + n.b (exact-name)
D (original) 1 — ADD IF NOT EXISTS n Nested(a) ×2 added once
E 0 — ADD IF NOT EXISTS p Nested(a) ×2 flattened p.a collides → no-op second
F 1 n.a ADD IF NOT EXISTS n String whole no-op (hasNested), n not added

Regression test 01318_alter_add_column_exists extended with the share_nested_offsets = 1 divergence case (A) and the = 0 exact-name case (C). Verified both directions: the exact-name-only binary inserts a spurious n.b in case A (diverges from validate()); the fixed binary no-ops it. The two DUPLICATE_COLUMN assertions and all earlier nested cases still pass.

Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes — CREATE TABLE t (id UInt64) ENGINE=MergeTree ORDER BY id; ALTER TABLE t ADD COLUMN \n.a` Array(UInt32), ADD COLUMN IF NOT EXISTS n Nested(a UInt32, b String);on default settings insertsn.b` before the fix, no-ops after.
b Root cause explained? validate()/prepare() gate n/n.* equivalence on share_nested_offsets; apply() did not receive it, so its exact-name compare diverged under the default share_nested_offsets=1 (added n.b while validate treated the whole nested add as already-present).
c Fix matches root cause? Yes — threads the same share_nested_offsets decision into apply(), so apply's existence rule is identical to validate's for both setting values.
d Test intent preserved / new tests added? Yes — extended 01318 with the sno=1 divergence case (A) and sno=0 exact-name case (C); all prior cases and both DUPLICATE_COLUMN assertions retained.
e Both directions demonstrated? Yes — exact-name-only binary (Build ID 1117596) inserts spurious n.b in case A; fixed binary (c56d24c) no-ops it and full 01318 reference matches.
f Fix is general across code paths? Yes — share_nested_offsets threaded through both AlterCommands::apply and AlterCommand::apply, and passed from all three MergeTree apply call sites (StorageMergeTree, StorageReplicatedMergeTree, MergeTreeData::checkAlterIsPossible); non-MergeTree callers keep the safe default true.
g Fix generalizes across inputs? Yes — verified the full matrix (sno {0,1} × {n exists / only n.a / nothing} × {double-INE nested, ADD n.a then ADD IF NOT EXISTS n Nested}) plus single-field and multi-field nested groups and a distinct top-level scalar.
h Backward compatible? Yes — no setting default, on-disk, wire, or metadata format change; only aligns apply()'s in-memory existence check with the long-standing validate()/prepare() contract. New apply parameter defaults to true, preserving existing callers.
i Invariants and contracts preserved? Yes — apply() now upholds the same n/n.* equivalence contract as validate()/prepare() for every share_nested_offsets value, so validate() and apply() no longer disagree and the final schema no longer depends on snapshot timing.

Session id: cron:clickhouse-worker-slot-1:20260711-143700

Comment thread src/Storages/AlterCommands.cpp Resolved
The apply-time IF NOT EXISTS nested guard was share_nested_offsets-aware
only on the explicit commands.apply() path. getMutationCommands ->
tryConvertToMutationCommand -> AlterCommand::apply still replayed with the
default share_nested_offsets = true, so for share_nested_offsets = 0 tables
the mutation-planning snapshot diverged from the real apply. A table with
only n.a then ADD COLUMN IF NOT EXISTS n String, RENAME COLUMN n TO n2 would
skip the add (hasNested matched n.a) and RENAME threw from
ColumnsDescription::rename. Thread the flag through
tryConvertToMutationCommand / getMutationCommands from all MergeTree callers.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Comment thread src/Storages/AlterCommands.cpp Resolved
The apply-time ADD COLUMN IF NOT EXISTS no-op gated the exact
metadata.columns.has(column_name) match on share_nested_offsets, but
prepare()/validate() treat an exact existing column as a whole-command
no-op unconditionally. Only the n/n.* nested equivalence (hasNested) is
share_nested_offsets-gated. Pull has(column_name) out of the gate so
apply() matches validate()'s existence predicate; with
share_nested_offsets=0, ADD COLUMN n String, ADD COLUMN IF NOT EXISTS n
Nested(a,b) no longer diverges (second command stays a no-op).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Comment thread src/Storages/AlterCommands.cpp Resolved
validate() advanced its working snapshot with a synthetic top-level n for
an ADD COLUMN n Nested(...), while apply() materializes the flattened
children n.a/n.b. A later command in the same ALTER targeting a real child
(RENAME COLUMN n.b) was then rejected in validate() with Cannot find column
n.b even though apply() would have created it. This divergence predates the
IF NOT EXISTS work (a plain ADD COLUMN n Nested(a,b), RENAME COLUMN n.b hit
the same wrong path).

Factor the flatten_nested expansion + IF NOT EXISTS existence filter into a
single columnsAddedByAlter helper used by both AlterCommand::apply and
AlterCommands::validate, so the two can no longer disagree on the columns a
(nested) ADD introduces.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Comment thread src/Storages/AlterCommands.cpp Resolved
…ertToMutationCommand

The mutation branch of AlterCommand::tryConvertToMutationCommand called
apply(metadata, context) with the default share_nested_offsets, so the
mutation-planning intermediate metadata could diverge from the real
commands.apply for share_nested_offsets = 0 tables. Pass the threaded
share_nested_offsets so both replay paths agree.

Ignored commands cannot reach this branch: isRequireMutationStage returns
false when ignore is set, so a command marked ignore by prepare() (an unmet
IF [NOT] EXISTS precondition) returns {} earlier and queues no mutation.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — db3437f

Every failure below has an owner: a fixing PR (ours), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt. None is caused by this PR (which only touches AlterCommands ADD COLUMN apply/validate + its regression test — no code path reaches EXPLAIN ANALYZE, FillingTransform, replicated-DB alter propagation, or the parallel-replicas protocol).

Check / test Reason Owner / fixing PR
AST fuzzer (amd_debug) / Logical error: 'clock' (STID 2508-42dd), EXPLAIN ANALYZE ... STREAM LIMIT trunk assertion (4 unrelated PRs/30d) #110077 (ours, open) — Reject EXPLAIN ANALYZE for STREAM queries
AST fuzzer (targeted, old_compat) / Logical error: 'row < chunk.getNumRows()' (STID 2508-3b8e), WITH FILL trunk FillingTransform family (10 unrelated PRs/30d) #101099 (ours, open) — FillingTransform Invalid number of rows
Integration (amd_tsan, 3/6) / test_replicated_table_structure_alter (1\t2 vs 1\t2\t3) flaky (11 master + ~15 unrelated PRs/30d) #110030 (ours, open) — Fix flaky test_replicated_table_structure_alter
Integration (arm_binary, distributed plan, 3/4) / test_parallel_replicas_protocol::test_backward_compatability (optimize table t final) flaky (14 hits #107886 + scattered/30d) a fix task is created (investigating at full effort — fixing-PR link to follow here)
CH Inc sync — CH Inc sync (private, not actionable)

Session id: cron:our-pr-ci-monitor:20260712-000000

@groeneai

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the parallel_replicas_protocol OPTIMIZE FINAL flaky (backward-compat, arm_binary distributed plan): #110129

@clickhouse-gh

clickhouse-gh Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.80% 85.80% +0.00%
Functions 92.70% 92.70% +0.00%
Branches 78.00% 78.00% +0.00%

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

Full report · Diff report

@tuanpach tuanpach self-assigned this Jul 18, 2026
@tuanpach
tuanpach enabled auto-merge July 18, 2026 01:23
@clickhouse-gh

clickhouse-gh Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

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

This PR only reworks ALTER TABLE ADD COLUMN IF NOT EXISTS handling for nested columns (the DDL apply/validate path); it does not touch SELECT query execution. Both flagged ClickBench queries (Q4 -23.1%, Q15 -14.5%) show faster medians but essentially unchanged CPU, and both land inside master's current variance band, so the deterministic within-envelope no_change verdicts are correct. There is no plausible mechanism for this change to affect either query — the deltas are run-to-run variance, not a real PR effect.

clickbench

🟢 No significant changes

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: 85e76cd0-91ed-456d-85fa-726467a07edf
  • MIRAI run: f5684216-a5e0-4b3a-b71d-6e91f3b859bd
  • PR check IDs:
    • clickbench_952017_1785411290
    • clickbench_952031_1785411290
    • clickbench_952037_1785411290
    • tpch_adapted_1_official_952049_1785411290
    • tpch_adapted_1_official_952060_1785411290
    • tpch_adapted_1_official_952088_1785411290

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 23d0027

CI is fully finished on this head (Finish Workflow success, 153 success / 18 skipped, zero failures).
No failed check, so there is nothing to own.

Session id: cron:our-pr-ci-monitor:20260726-163000

@tuanpach
tuanpach added this pull request to the merge queue Jul 30, 2026
Merged via the queue into ClickHouse:master with commit b42cfde Jul 30, 2026
176 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 Jul 30, 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 pr-bugfix Pull request with bugfix, not backported by default 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