Repository navigation
Rebuild a reduced and when pruning parts and files by virtual columns - #125126
antaljanosbenjamin merged 4 commits into
Conversation
`splitFilterNodeForAllowedInputs` keeps only the conjuncts of an `and` that can be evaluated on the allowed (virtual) inputs. When two or more of them survive, it returned the copied node as is, so the node had fewer children than the `function_base` it carries was built for. Executing it eagerly happens to work, because `and` accepts any arity. Since ClickHouse#125033 these filters honour `short_circuit_function_evaluation`. A reduced `and` that is a lazily evaluated argument of another short-circuit function (for example the right side of an `or`) and has a lazy-suitable descendant is wrapped by `ExpressionActions` as a `ColumnFunction` with the stale 3-argument function and 2 captured columns, and `ColumnFunction::reduce` throws `LOGICAL_ERROR: Cannot call function and because is has 3 arguments but 2 columns were captured`. Found by the AST fuzzer in `Stress test (amd_tsan)` on master. Build a fresh `and` for the kept children instead, and convert its result back to the original type with `addBooleanCondition`, as the single-child path above already does. `ActionsDAG::removeUnusedConjunctions` rebuilds a reduced conjunction the same way. This keeps the invariant the `or` branch and the all-children-kept `and` branch rely on: every returned node has a function built for exactly its children and the input node's result type. The new test fails on master (the server aborts) and passes with the fix; a build from before ClickHouse#125033 also passes it, so the defect is master-only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`max_rows_to_read` fails the test if the virtual-column filter stops pruning partition 0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review (click to expand)
|
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261011-002400 |
|
Workflow [PR], commit [f01040d] Summary: ✅
AI ReviewSummaryThis PR fixes the virtual-column predicate splitter so that when it drops some conjuncts from an Final Verdict
|
Build profile diff (arm_release)Commit See the job log for details. |
CI finish ledger - 8209507Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20261011-053007 |
…indexHint arity bug it fixes ClickHouse#125150 fixes `Cannot capture 1 column(s) because function indexHint has 0 arguments` (STID 3408-3735) on the same virtual-column pruning path, while its own targeted AST fuzzer fails on the reduced `and` fixed here. Carry both fixes together so each one's fuzzer run is clean. Report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125126&sha=820950765c6c5aeb285ba1b91ae04ef5bc1c1de6&name_0=PR&name_1=AST%20fuzzer%20%28amd_debug%2C%20targeted%29
|
Merged #125150 into this branch. The targeted AST fuzzer here failed only on |
and when pruning parts and files by virtual columnsand and indexHint nodes for their actual arguments when pruning by virtual columns
|
Thanks. I updated the title and description to cover both fixes. |
|
@groeneai pull master to this PR |
…lumn-filter-partial-and
and and indexHint nodes for their actual arguments when pruning by virtual columnsand when pruning parts and files by virtual columns
Related: #125033
Related: #125150
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Description
On master since #125033, pruning parts and files by virtual columns can fail with
Cannot call function and because is has 3 arguments but 2 columns were captured.(STID 2458-4cb4, Stress test (amd_tsan) on master), a logical error that aborts debug and sanitizer builds:splitFilterNodeForAllowedInputskeeps only the conjuncts of anandcomputable from the virtual columns, but returned the copy with the originalfunction_base, built for all the arguments. Eager execution tolerates that; since #125033 these filters honourshort_circuit_function_evaluation, so the reducedandin a lazily evaluated position becomes aColumnFunctionthat rejects its captured columns. The reducedandis now rebuilt for the kept children and its type converted back (asActionsDAG::removeUnusedConjunctionsdoes).The sibling
indexHintdefect on the same path (STID 3408-3735) was fixed by #125150, which is now in master, so this PR carries only theandfix.The new test
05359fails on master and passes with this change (50 randomized runs), and itsmax_rows_to_readlimit checks that pruning still happens. The defect is master-only (#125033 is in no release), henceNot for changelog.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/125126]
Version info
26.10.1.2290-master(included in26.10and later)