Repository navigation
Add test: Non-deterministic LIMIT BY-key predicate blocked from pushdown (the step_changes_the_number_of_rows=true gate) is untested - #110181
Conversation
|
Pre-PR Validation Gate (per ClickGap pipeline): a) Deterministic repro? ✅ b) Root cause explained? ✅ c) Fix matches root cause? ✅ d) Test intent preserved? / New tests added? ✅ e) Both directions demonstrated? ✅ f) Fix is general, not a narrow patch? ✅ |
|
Workflow [PR], commit [5e0bf35] Summary: ✅ AI ReviewSummaryThis PR adds a stateless regression test for the Final Verdict
|
Requested by @clickhouse-gh[bot] in ClickHouse#110181 (comment)
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
This is a test-only PR — no source code changes. Please review: test quality, whether the claimed coverage gaps are real, and whether test output makes sense.
Adds test coverage for 1 untested code path(s), found during automated review of PR #110116.
That PR The PR adds a
LimitByStepcase totryPushDownFilterinfilterPushDown.cpp: aWHEREconjunct whose inputs are a subset of theLIMIT BYkey columns (LimitByStep::getColumns()) is pushed below theLimitByStep, so it can reach storage as a primary-key condition. The push is gated to `OFFSE1. Non-deterministic
LIMIT BY-key predicate blocked from pushdown (thestep_changes_the_number_of_rows=truegate) is untestedsrc/Processors/QueryPlan/Optimizations/filterPushDown.cpp:1038,src/Processors/QueryPlan/Optimizations/filterPushDown.cpp:160Risk: Call chain:
tryPushDownFilter-> LimitByStep case (filterPushDown.cpp:1038) ->tryAddNewFilterStep(parent_node, true, ...)->splitFiltersetsallow_deterministic_functions = !true = false(line 160) ->splitActionsForFilterPushDownrefuses to push non-deterministic conjuncts. RISK: if this argument were flipped tofalse, a per-row non-deterministic key predicate would be pushed belowLIMIT BYand evaluated on all input rows before the per-group top-N, changing which rows …What's unique vs PR tests: PR test 04366 only uses deterministic predicates (
key = '5',intDiv(1, toInt32(key))), which exercise the pushed branch. This test adds the negative case: a per-row non-deterministic key predicate that thestep_changes_the_number_of_rows=truegate must KEEP aboveLIMIT BY— the specific behavior thetrueargument encodes and which no existing test covers.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not applicable — test-only change.
Documentation entry for user-facing changes