Repository navigation
Conversation
|
Workflow [PR], commit [b1a9db7] Summary: ❌
AI ReviewSummaryThis is a stacked branch, and I reviewed the requested runtime-filter commits Missing context / blind spots
Final Verdict✅ No new blockers or majors in the reviewed scope. LLVM Coverage ReportMeasured on commit b1a9db7.
Changed lines: Changed C/C++ lines covered: 718/755 (95.10%) · Uncovered code |
This comment was marked as resolved.
This comment was marked as resolved.
2c8f112 to
9d7306d
Compare
| size_t filters_to_merge, | ||
| const DataTypePtr & target_type, | ||
| const RuntimeFilterBuildOptions & build_options, | ||
| const RuntimeFilterConfig & runtime_filter_config) |
There was a problem hiding this comment.
File local change. This function body got extracted from a BuildRuntimeFilterTransform constructor below.
| parameters.bytes | ||
| = growRuntimeBloomFilterBytesFromStats(*distinct_keys_hint, parameters.hash_functions, parameters.bytes, max_ratio_of_set_bits); | ||
| return parameters; | ||
| } |
There was a problem hiding this comment.
Extracted from AdaptiveSetRuntimeFilter::switchToApproximateFilter in src/Processors/QueryPlan/RuntimeFilterLookup.cpp
| const auto bloom = sizeRuntimeBloomFilter( | ||
| RuntimeBloomFilterParameters{exact_filter->getBytesLimit(), bloom_filter_hash_functions}, | ||
| distinct_keys_hint, | ||
| max_ratio_of_set_bits_in_bloom_filter); |
There was a problem hiding this comment.
Merged from:
exact_filter->getBytesLimit()from line 678- evaluation of
distinct_keys_hintand call togrowRuntimeBloomFilterBytesFromStatsin line 682-683
This also allows to merge if (distinct_keys_hint) and if (distinct_keys_hint_matches_filter_key) in lines 680, 678 to remove one level of nesting (see new line 685).
9d7306d to
9c74d24
Compare
Prep for #96779 (MinMaxRuntimeFilter), #97501 (Introduce statistics-based disabling of join runtime filters).
Merges after #121597 (RuntimeFilterBuildOptions, merged).
Merges after #121736 (Track and cache provenance-aware relation statistics for JOIN optimization).
JOIN runtime filters are ultimately addressed by column name, but query-plan headers can legally contain duplicate names. This occurs, for example, after correlated-subquery decorrelation or projections such as
SELECT column, *.The previous guard inspected build-side key names before
JoinStepLogical::preCalculateKeys(). It could not reliably identify computed keys introduced during key pre-calculation, and it disabled runtime filtering too broadly for unrelated duplicate columns. In affected plans, an ambiguous build key could also lead to aBlock structure mismatch in JoinSteperror.Changes
preCalculateKeys(), covering both plain and computed keys.LEFT ANTI JOINtuple filters if any component key is ambiguous.FilterStepwhen no executable runtime filter remains.anti joins.
their execution policy.
As this PR is stacked on top of #121736 please review git commits 9d7306d and 115317d only.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed JOIN runtime-filter planning for build-side headers containing duplicate column names. Runtime-filter keys are now resolved against unique header positions, preventing
Block structure mismatcherrors while retaining filters for unambiguous keys.Workflow [PR]
Sync PR [sync-upstream/pr/121647]