Repository navigation
Propagate outer WHERE through StorageView for skip unused shards - #98754
Conversation
|
Workflow [PR], commit [19a4e3d] Summary: ❌
|
When querying a `Distributed` table through a `View` with `force_optimize_skip_unused_shards = 1`, the query failed with `UNABLE_TO_SKIP_UNUSED_SHARDS` because the outer WHERE clause was never propagated to the inner distributed table during filter analysis. Fix: recognize `StorageView` in `collectFiltersForAnalysis`, and accept an optional post-filter parameter that flows from `StorageView::read` through `InterpreterSelectQueryAnalyzer` and `Planner` into filter analysis, where it is injected as a `FilterStep` on top of the dummy plan. Predicate pushdown then pushes it to the `ReadFromDummy` for the distributed table, making the filter available for shard skipping. Closes #98613 Co-Authored-By: Claude Opus 4.6 <[email protected]>
f13e162 to
19a4e3d
Compare
StorageView for skip unused shards
#99872
…for skip unused shards
…for skip unused shards
Backport #98754 to 26.2: Propagate outer WHERE through `StorageView` for skip unused shards
|
Hi @KochetovNicolai @novikd — while reviewing this PR I found the following:
Could you review the test PR and add the |
Backport #98754 to 26.1: Propagate outer WHERE through `StorageView` for skip unused shards
@clickgapai where is reference to coverage gap report? |
|
@devcrafter — fair question. Here's the evidence: Current test coverage: PR includes one test for the basic case: Untested paths in the diff:
I verified all four scenarios work correctly on master with |
|
This automated ClickGap comment is withdrawn — it surfaced internal tooling detail or was posted incompletely, and isn't actionable as written. Please disregard. (ClickGap's output guard now prevents this.) |
When querying a
Distributedtable through aViewwithforce_optimize_skip_unused_shards = 1, the query failed withUNABLE_TO_SKIP_UNUSED_SHARDSbecause the outer WHERE clause was never propagated to the inner distributed table during filter analysis.Fix: recognize
StorageViewincollectFiltersForAnalysis, and accept an optional post-filter parameter that flows fromStorageView::readthroughInterpreterSelectQueryAnalyzerandPlannerinto filter analysis, where it is injected as aFilterStepon top of the dummy plan. Predicate pushdown then pushes it to theReadFromDummyfor the distributed table, making the filter available for shard skipping.Closes #98613
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix
optimize_skip_unused_shardsoptimization with the analyzer in caseDistributedstorage is used in aView.Documentation entry for user-facing changes
Version info
26.3.1.42926.2.5.38,26.1.8.9