Skip to content

Do not move a condition that can throw to PREWHERE in front of the conditions written before it - #129178

Merged
fm4v merged 16 commits into
ClickHouse:masterfrom
groeneai:prewhere-keep-conditions-before-throwing-one
Nov 22, 2026
Merged

fm4v merged 16 commits into
ClickHouse:masterfrom
groeneai:prewhere-keep-conditions-before-throwing-one

Conversation

@groeneai

@groeneai groeneai commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Closes: #83611
Related: #100827

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 queries failing with an exception like CANNOT_PARSE_DATETIME when the automatic move of WHERE conditions to PREWHERE put a condition that can throw (for example toDateTime64 of a String) in front of a condition written before it that excludes the offending rows. Such a condition is now moved only after the conditions written before it, as short-circuit and evaluates it. The new setting optimize_move_to_prewhere_respect_short_circuit (enabled by default) controls this. Closes #83611.

Description

On 26.10.2.103 (and 26.3, 26.8, master), the query from #83611 fails with CANNOT_PARSE_DATETIME, although the CTE's WHERE a = 'one' excludes the only row that cannot be parsed.

Root cause. query_plan_merge_filters merges both filters into and(equals(a, 'one'), notIn(tuple(b, toDateTime64(...)))), where and evaluates the second argument only on the rows passing the first. MergeTreeWhereOptimizer picks PREWHERE conditions by cost only: move_primary_key_columns_to_end_of_prewhere ranks a = 'one' last, so the first read step computes toDateTime64 on every row. Likewise when the guard stays in WHERE, or via grouping, statistics or force_enable. PREWHERE in one step (enable_multiple_prewhere_read_steps = 0, or Memory with a non-deterministic condition, also in a written PREWHERE) computes the toDateTime64 passed on to the projection on every row, in any order.

Change. A condition that and would keep behind the conditions before it (a lazily executed function that can throw or is order-sensitive, as in canBeExecutedOnMoreRows) is moved to PREWHERE only after them and is not grouped across them. When PREWHERE may run in one step, one that also computes a value needed outside it is moved only to an empty PREWHERE. With force_enable, each condition gets its own PREWHERE step and every step filters its rows. This is #100827's rule. The new setting optimize_move_to_prewhere_respect_short_circuit (default 1, compatibility below 26.12 sets 0) restores the previous order, as does short_circuit_function_evaluation = 'disable'.

Tests. New 05497 fails on master in every case but disable; 05830 keeps a constant-pattern LIKE ordered by cost. 04053's bug case now returns good.

Price. A function without canThrowIfKnown counts as one that can throw, so lower(s) = 'x' stays in WHERE behind a condition that stays there, e.g. one reading every queried column (3x slower in the review). #100827's example on 10M rows takes 0.081 s vs 0.031 s on master.


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

Version info

  • Merged into: 26.12.1.213-master (included in 26.12 and later)

groeneai and others added 2 commits November 4, 2026 04:44
…nditions written before it

With `query_plan_merge_filters` the CTE filter `a = 'one'` and the outer
`(b, toDateTime64(usage_timestamp, 3)) NOT IN (...)` are merged into one AND chain.
Short-circuit `and` evaluates the second argument only on the rows passing the
first, but `MergeTreeWhereOptimizer` chose the PREWHERE order by its cost tuple
alone: `move_primary_key_columns_to_end_of_prewhere` ranked the primary key guard
last, so the first read step parsed every row and threw CANNOT_PARSE_DATETIME.
The same happened when the guard was not viable and stayed in WHERE, when the
throwing conjunct was grouped with an earlier one on its column across the guard,
with statistics (04053 recorded it as a known bug), and with `force_enable`.

A condition that `and` would keep behind the arguments before it (some lazily
executed function can throw, is stateful, has side effects or is not
deterministic: the test of `findLazyExecutedNodes` / `canBeExecutedOnMoreRows`)
is now a PREWHERE candidate only when it is the first condition left in WHERE,
i.e. after every condition written before it was moved, and it joins a column
group only if every conjunct between the group's first one and it belongs to the
group. Other conditions are ordered as before. This is the rule from ClickHouse#100827
("any prefix of the AND chain can be pushed down without checking, and
conditions in the middle if they are not-throwing").

Reference changes: 02842 (`like` waits behind the conditions written before it),
04053 (the bug arm returns `good`), 05316 (a `LIKE` after an AI condition keeps
both in WHERE, in the written order).

Closes ClickHouse#83611

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Condense the four added comment blocks in MergeTreeWhereOptimizer to one line each.

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

groeneai commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

cc @KochetovNicolai @Avogar, could you review this and add the can be tested label so CI runs? MergeTreeWhereOptimizer picked PREWHERE conditions by cost only, so a condition that short-circuit and evaluates lazily and that can throw (here toDateTime64 of a String) ran before the guard written in front of it; such a condition is now moved only after those conditions, the rule from #100827.

@clickhouse-gh

clickhouse-gh Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e92697f]

Summary: ✅


AI Review

Summary

At e92697fca9749823d734be5e79c0e3f44c7343c8, this PR preserves short-circuit guards when moving WHERE conditions into PREWHERE, including shared outputs in single-step execution, and adds optimize_move_to_prewhere_respect_short_circuit to restore the previous ordering. Approve the scoped fix; there are no new inline findings. Tests 04053, 05497, and 05830 match their references on the head's CI binary, including 04053 with filter merging disabled.

Findings
Final Verdict

Status: ✅ Approve

No additional changes required for this PR's accepted scope. The separately tracked Parquet limitation above remains open.

@clickhouse-gh clickhouse-gh Bot added pr-bugfix Pull request with bugfix, not backported by default comp-mergetree MergeTree* family: parts, merges, primary index, column statistics, background data transformation. can be tested Allows running workflows for external contributors labels Nov 4, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing e92697fca with master 841a49bef (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.

Object file sizes

8 object files changed (+34.05 KiB total), 0 added.

Object file Master PR Δ
src/CMakeFiles/dbms.dir/Storages/MergeTree/MergeTreeWhereOptimizer.cpp.o 269.35 KiB 300.89 KiB +31.55 KiB (+11.71%)

716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

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

Median compile-time ratio to the baselines is ×1.07 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio.
The matched translation units cost +5.2 s (+9%) in total before that adjustment.

Job report

groeneai and others added 3 commits November 4, 2026 07:43
… short-circuit is disabled

With `enable_multiple_prewhere_read_steps = 0` PREWHERE is one expression, and a
node it passes on to the rest of the query (the `toDateTime64` the projection also
needs) is an output, so it is not executed lazily and runs on every row whatever
the order of `and`. The query from ClickHouse#83611 and `a = 'one' AND toDateTime64(s, 3) > X`
selecting the conversion still failed with CANNOT_PARSE_DATETIME there, also when the
guard and the conversion were grouped on one column or the guard was an explicit
PREWHERE (`optimize_prewhere_after_pushdown = 1`).

With one read step, a condition that must follow the preceding ones and computes a
function node also needed by another conjunct or another output of the filter DAG is
now moved only to an empty PREWHERE and is not grouped with earlier conjuncts. A
condition without such a node keeps being moved, because there `and` still executes
it lazily (holding every such condition back changed 02346, 03317, 05326 and 05316
with one read step, which CI randomizes).

With `short_circuit_function_evaluation = 'disable'` nothing is executed lazily, so
there is no order to keep: no condition must follow the preceding ones there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The result checks alone also pass if nothing is moved to PREWHERE with one read step.
Check that the guard and a condition that cannot throw are still moved, also next to an
explicit PREWHERE, and that a conversion nothing else needs is still moved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…en steps with force_enable

Apply the rule for a condition that computes a node needed outside it whenever PREWHERE may run in
one step: with `enable_multiple_prewhere_read_steps = 0`, and when the filter DAG has a
non-deterministic or stateful function, because Memory then evaluates PREWHERE in one step even with
multiple steps enabled (`a = 'one' AND toDateTime64(s, 3) > X AND rand(x) >= 0` selecting the
conversion threw CANNOT_PARSE_DATETIME on a Memory table). Applying it unconditionally was measured
and rejected: it keeps a join runtime filter on a guarded CAST key out of the read (04630).

With `short_circuit_function_evaluation = 'force_enable'` every function is executed lazily, but a
PREWHERE step was asked to filter its rows only for conditions that are lazy by themselves or with
`query_plan_merge_filters`. With `query_plan_merge_filters = 0` and a guard that passes more than 60%
of the rows, the range reader did not filter, and `timestamp(s)` ran on the rejected row. Force the
filter with `force_enable` as with `query_plan_merge_filters`.

05497 gets a check of the PREWHERE placement with multiple steps, the force_enable arm with a guard
passing 90% of the rows, and the Memory arm.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	src/Processors/QueryPlan/Optimizations/optimizePrewhere.cpp
#	src/Storages/MergeTree/MergeTreeWhereOptimizer.cpp
#	src/Storages/MergeTree/MergeTreeWhereOptimizer.h
@fm4v

fm4v commented Nov 16, 2026

Copy link
Copy Markdown
Member

@groeneai resolve conflicts

…tions-before-throwing-one

The conflict in `MergeTreeWhereOptimizer::analyzeImpl` is resolved by keeping master's grouping key
(physical columns for a guarded throwing condition, split by primary key use) and applying the
PR's check that a condition that must follow the preceding ones does not join a group across
conjuncts that are not in it.

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

Copy link
Copy Markdown
Collaborator Author

Resolved: merged master in 3fd8c02. The only conflict was in MergeTreeWhereOptimizer::analyzeImpl: I kept master's grouping key (physical columns for a guarded condition, split by primary key use) and applied this PR's check on top of it. The query from #83611 still fails on master and returns the row on this head, with enable_multiple_prewhere_read_steps 0 and 1.

@fm4v

fm4v commented Nov 17, 2026

Copy link
Copy Markdown
Member

@groeneai the review-threads gate blocks this PR and the full CI suite was skipped on head 3fd8c02 (https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129178&sha=3fd8c0245d8ccfe48c8f73efa8a6be1ab27e416b&name_0=PR&name_1=Finish%20Workflow). Either fix the two remaining paths from the open thread on MergeTreeWhereOptimizer.cpp (include the existing PREWHERE in the one-step execution-mode decision for Memory; make the PREWHERE step splitter respect force_enable for timestamp-like throwing functions) with regressions in 05497, or, if you keep them out of scope as pre-existing on master, file a tracking issue for them, link it in the thread and resolve it so full CI runs; then report the full CI result on the new head.

Memory evaluates PREWHERE in one step when the combined PREWHERE has a
non-deterministic or stateful function. A user-written PREWHERE with
`rand` merged with the moved WHERE (`optimize_prewhere_after_pushdown = 1`)
did not count, because only the WHERE DAG was checked, so a conversion
that the projection also needs was moved and computed for all rows.
Check the existing PREWHERE too.

With `short_circuit_function_evaluation = 'force_enable'` every function
is executed lazily, but the PREWHERE step splitter still merged a
condition on the guard's column into the guard's step when the function
does not report itself suitable for short-circuit execution (`timestamp`).
In one step the conversion passed on is computed for all rows. Give such
a condition its own step under `force_enable`.

Both shapes are from the review of ClickHouse#129178 and fail on master as well.

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

Copy link
Copy Markdown
Collaborator Author

I fixed both paths in this PR instead of filing an issue, in f1d1188: the one-step check now also looks at the existing PREWHERE (for Memory with rand in it), and with force_enable the PREWHERE step splitter puts each condition in its own step, so a timestamp conversion passed on to the projection is computed only for the rows the guard keeps. Both examples from the thread fail with CANNOT_PARSE_DATETIME on the previous head 3fd8c02 and return the row on this one; 05497 has a statement for each.

I did not resolve the thread myself: it was opened by clickhouse-gh, which resolves its own threads once its review accepts the fix, and the full suite re-runs after that. I will post the full CI result here when it finishes on this head.

…g conditions

`mustFollowPrecedingConditions` asked `canThrow` without the constant columns of the arguments, so `canThrowIfKnown` of `like`, `ilike` and `notLike` could not see the pattern and answered that the function can throw. Every `LIKE` with a constant pattern was therefore treated as a condition that must follow the conditions written before it: it was no longer moved to PREWHERE in front of them by cost, and not moved at all behind a condition that stays in WHERE. A `LIKE` on a `String` with a valid constant pattern cannot throw (the pattern is compiled once), and `prewhereConditionCannotThrow` and `canBeMovedToTheFrontOfAndChain` already pass the constant column for this reason.

Pass the constant column here as well. The references of `02842_move_pk_to_end_of_prewhere` and `05316_ai_functions_last_in_prewhere` are back to what they are on master: a `LIKE` is ordered by cost again, and an AI function written before a `LIKE` runs in PREWHERE after it instead of on all rows in WHERE.

Related: ClickHouse#129178
@fm4v

fm4v commented Nov 19, 2026

Copy link
Copy Markdown
Member

@groeneai and reviewers: I reviewed head 9f847e4 and pushed one fix. Nothing was built locally, so the new commit relies on CI.

Fixed

LIKE with a constant pattern was treated as a condition that can throw (a7341e6). mustFollowPrecedingConditions built the arguments for canThrow without the constant columns, so MatchImpl::canThrowIfKnown could not see the pattern and answered "can throw" for every like, ilike and notLike. prewhereConditionCannotThrow and canBeMovedToTheFrontOfAndChain pass the column, so the optimizer disagreed with both. The effect was a plan regression for the most common heavy predicate: WHERE sipHash64(a, b, s) != 0 AND s LIKE '%x%' no longer moved the LIKE to PREWHERE, and WHERE big_column = 'x' AND small_column LIKE '%y%' read big_column for all rows first. It is also why this PR had to change 02842_move_pk_to_end_of_prewhere.reference and 05316_ai_functions_last_in_prewhere.reference (there the AI function ended up running on all rows in WHERE). The commit passes the constant column, restores both references to master, and adds 05830_prewhere_like_constant_pattern_not_held_back.

The PR description needs an update: the sentences about 02842 and about a LIKE after an AI condition (05316) no longer hold.

Not fixed, needs a decision

  1. A throwing condition that is not executed lazily is still moved in front of its guard at default settings. The rule holds back only lazy functions, but with query_plan_merge_filters = 1 WHERE runs the AND chain as separate filter transforms (FilterStep::transformPipeline), so there every condition is guarded, lazy or not. SELECT payload FROM u WHERE s != 'invaliddatetime' AND timestamp(s) > '2020-01-01' (the example from the resolved thread, without force_enable) still throws CANNOT_PARSE_DATETIME and works with optimize_move_to_prewhere = 0. The same applies by code reading to addDays on a String and to Decimal plus/multiply overflow. It fails on master too, so it is not a regression, but it is the same class as query_plan_merge_filters disrupted short-circuit evaluation #83611. I did not code it: dropping the lazy requirement makes every function without canThrowIfKnown (in, the date functions) a held-back condition, which would turn cost-based ordering off for most queries.

  2. The price and the backport. Every short-circuit-suitable function without canThrowIfKnown is held back: lower(s) = 'x', has(arr, x), match, position, JSONExtract*, toString, dictGet. Such a condition loses cost ordering and is not moved at all behind a condition that stays in WHERE (a non-sorting-key condition with FINAL, a condition reading every queried column). The only switch is short_circuit_function_evaluation = 'disable'. There is no setting and no SettingsChangesHistory entry, so compatibility cannot keep the old plans once this is backported to 26.10. Options: accept it, add a setting (as suggested in Different predicate-push-down optimizations does not respect short-circuit #100827), or add canThrowIfKnown to the common string functions first.

  3. Performance evidence is stale. The only Performance Comparison is for dd90988 (arm only, 4408 queries, no changes). f1d1188, 9f847e4 and a7341e6 have none, and the amd shards were skipped without pr-performance.

Checked, no problem found

The selection loop (a held-back condition moves only when it is the first one left in WHERE, also with the size threshold and with allow_reorder_prewhere_conditions = 0), the grouping check, an existing user PREWHERE, the row policy step, the force_enable step split, the disable exemption, the statistics path. Join runtime filters are not held back at default settings.

CI

No test failures on 9f847e4: the only red job was Finish Workflow (the review-threads gate), all threads are resolved now. The last full run (dd90988) was green.

@clickhouse-gh
clickhouse-gh Bot dismissed their stale review November 19, 2026 19:37

AI review of a later commit does not approve the PR, see the AI Review comment.

@groeneai

groeneai commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Thanks for the fix and the review.

CI on a7341e6: the full suite ran and finished with one failed test, 05293_autopr_statistics_plan_based in Stateless tests (arm_binary, ParallelReplicas, plan-based, s3 storage, parallel). It has failed on master and on 26 other PRs since 2026-11-19, and #133069 (merged) fixes it. The arm Performance Comparison ran on this head and reported no changes (2 unstable queries).

  1. Non-lazy throwing conditions: I agree to keep them out of this PR, for the reason you gave. They are fixed per function: once a function is executed lazily, this PR's rule covers it. timestamp is Do not evaluate timestamp on rows that a preceding condition excludes #132120 and the add* date functions are Fix addDays and other date add functions throwing on rows rejected by a short-circuit condition #128895. Decimal multiply reproduces as you expected: WHERE k = 'ok' AND x * toDecimal32(10, 0) > 0, with x = 999999999 in the excluded row, throws DECIMAL_OVERFLOW on master and on this head, and returns the row with optimize_move_to_prewhere = 0. I will send a separate PR for it, done the same way.
  2. Price and backport: I am adding the setting suggested in Different predicate-push-down optimizations does not respect short-circuit #100827, optimize_move_to_prewhere_respect_short_circuit (default 1, with a false -> true history entry in 26.12, so compatibility below 26.12 keeps the old plans). With 0, the selection is the same as on master, and short-circuit evaluation stays enabled. The lower(s) = 'keep' case from the bot's thread gets a plan test for both values. canThrowIfKnown for the common string functions would remove most of the price, but each function needs its own audit, so I am not adding it here.
  3. Performance: I cannot add pr-performance (no triage role on this repo). If you want the amd shards, please add it after my next push.

The same push updates the description: the 02842 and 05316 sentences, plus the setting.

groeneai and others added 2 commits November 20, 2026 00:54
Keeping a condition that can throw behind the conditions written before it
costs the ordering by cost for every lazily executed function without
`canThrowIfKnown` (`lower`, `position`, `has`, ...): such a condition is not
moved in front of a condition that stays in WHERE. The only way to get the
previous plans back was `short_circuit_function_evaluation = 'disable'`, and
`compatibility` could not restore them.

The new setting (default `true`, `false` below `compatibility` 26.11) turns the
rule off for the PREWHERE optimizer only: with `false` the conditions are
selected as with `disable`, and short-circuit evaluation stays enabled.
As suggested in ClickHouse#100827.

`05497`: the `disable` case now uses `lower`, because a `LIKE` with a constant
pattern is no longer held back; a plan case for the setting and a control
without it are added.

Related: ClickHouse#129178

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Master is 26.12 now, so the `settings_changes_history` style check requires
the new setting's history record under the current version. With the record
under 26.12, `compatibility` 26.11 and below restore the previous order.

Related: ClickHouse#129178

Co-Authored-By: Claude Opus 5.5 <[email protected]>
clickhouse-gh[bot]
clickhouse-gh Bot previously approved these changes Nov 20, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - b486728

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
Performance Comparison (arm_release, master_head, 3/6) / clickbench crash, not from this PR: the server of this build was killed by SIGILL (signal 4) with no stack trace during the prewarm0 run of ClickBench query 28 (right/server.log: Child process was terminated by signal 4.), so the remaining ClickBench queries got Connection refused. The master reference server died the same way in another ARM perf run today (report): the AArch64 stack-unwinding SIGILL #132186 (mine, open)
PR praktika rollup of the row above #132186 (mine, open)

Mergeable Check is red only because of the rows above.

Session id: cron:our-pr-ci-monitor:20261120-053111

@groeneai

Copy link
Copy Markdown
Collaborator Author

@fm4v I need a decision on the Decimal follow-up I promised above before I send it. Done the same way (Decimal plus, minus and multiply executed lazily when decimal_check_overflow is on and no operand is a float), it removes the overflow behind the guard in if, multiIf, CASE, AND/OR, sum(if(...)) and a same-column PREWHERE, but the price is higher than I expected. RelWithDebInfo, 100M rows of (p UInt8, x Decimal64(2), y Decimal64(2)), 8 threads (similar at 64), ratio PR / master:

query PR / master
sum(if(p < 50, x * y, 0)) 1.35
sum(if(p < 99, x * y, 0)) 1.40
sum(if(p < 1, x * y, 0)) 1.25
sum(if(p < 50, x - y, 0)) 1.36
count() ... WHERE p < 50 AND x * y > 100 1.04
sum(if(p < 50, x * 1.1, 0)) (stays eager) 1.00

Two costs multiply: sum(if(...)) is no longer rewritten to sumIf (1.16x), and the lazy execution itself (1.13-1.17x, about the same as short_circuit_function_evaluation = 'force_enable' on master). Lazy is slower than eager even when 1% of the rows pass, so no selectivity wins it back. Decimal division, already lazy on master, pays the same way: sum(if(p < 50, x / (y + 1), 0)) is 1.22x slower than with short_circuit_function_evaluation = 'disable'.

Should I (A) send the PR with these numbers in the description, or (B) not send it and leave Decimal +, -, * eager?

@nickitat

Copy link
Copy Markdown
Member

I merged master into this branch to pick up #133069.

Since 2026-11-19, stateless tests randomize the MergeTree setting enable_adaptive_codec_selection, and 05293_autopr_statistics_plan_based failed in this PR's CI because of that, not because of the changes here. The fix pins the setting in the test; it is in master now, so the next CI run should not hit it.

🤖 Generated with Claude Code

@stresshouse

stresshouse Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

📊 Cloud Performance Report

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

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

clickbench

🟢 No significant changes

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: cee2a526-6c25-4c37-9c0b-cb4504e099fb
  • MIRAI run: 15da7216-e49b-4492-a586-f01450ad9d4d
  • PR check IDs:
    • clickbench_875716_1795390663
    • clickbench_875722_1795390663
    • tpch_adapted_1_official_875738_1795390663
    • tpch_adapted_1_official_875768_1795390663

@PedroTadim

Copy link
Copy Markdown
Member

@groeneai can you merge with master and fix the conflict?

Resolve the comment conflict in MergeTreeSplitPrewhereIntoReadSteps.cpp by keeping both lines.

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

Copy link
Copy Markdown
Collaborator Author

Done: I merged current master (9b2f29d) in 947befe. The only conflict was a comment line in MergeTreeSplitPrewhereIntoReadSteps.cpp next to the alias-splitting change from #129445; I kept both lines, and the PR's own changes are unchanged. I rebuilt it locally: the PR's tests and master's new PREWHERE tests (05508, 05509_aliased_conjunction_prewhere, 05836) pass.

@clickhouse-gh
clickhouse-gh Bot dismissed their stale review November 20, 2026 19:57

AI review of a later commit does not approve the PR, see the AI Review comment.

@fm4v fm4v added the pr-performance Pull request with some performance improvements label Nov 20, 2026
@fm4v
fm4v enabled auto-merge November 22, 2026 19:23
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-mergetree MergeTree* family: parts, merges, primary index, column statistics, background data transformation. pr-bugfix Pull request with bugfix, not backported by default pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-performance Pull request with some performance improvements pr-synced-to-cloud The PR is synced to the cloud repo v26.10-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

query_plan_merge_filters disrupted short-circuit evaluation

6 participants