Repository navigation
Fix logical error !subranges.empty() - #100543
Conversation
|
Workflow [PR], commit [fb6ba09] Summary: ✅ AI ReviewSummaryThis PR fixes an assertion failure in Parquet bloom-filter pushdown for empty ClickHouse Rules
Final Verdict
|
65f8644 to
1b3baf1
Compare
|
Bugfix validation (functional tests) |
|
@Algunenano Would you mind reviewing this when you have a moment? |
| if (!hashes.has_value() || hashes->empty()) | ||
| return std::nullopt; |
There was a problem hiding this comment.
Wait, doesn't this mean read all rows if there's IN ()? We should read none of the rows instead (unless it's something like (IN ()) OR 1). Or rather we shouldn't do anything special in this case, empty set can be handled the same way as any other set, AFAICT nothing will break except that assert in splitRange.
I think a better fix is to just skip the splitRange in processBloomFilterHeader if no blocks are needed:
std::vector<PrefetchHandle> prefetches;
if (!subranges.empty()) // can be empty e.g. if `WHERE x IN ()`
prefetches = prefetcher.splitRange(std::move(column.bloom_filter_data_prefetch), subranges, /*likely_to_be_used*/ false);(The reason splitRange requires nonempty list of subranges is that it transfers the memory tracking token from the original range into the subranges. If there are no subranges, it's unclear what to do with the memory tracking state. This proposed solution just leaves the token in bloom_filter_data_prefetch) until ReadManager::clearColumnChunk clears it soon after. This is fine.)
There was a problem hiding this comment.
Fixed as suggested, thanks.
|
If the test doesn't repro it, try adding |
1b3baf1 to
19c9108
Compare
|
(Changed category in PR description so that |
|
The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix. |
|
The test |
|
The MSan stress test failure (MemorySanitizer: use-of-uninitialized-value, STID 4179-5154 or 4148-3044) is a known pre-existing issue unrelated to this PR. Fix: #102158 |
|
The |
|
The flaky check failure is fixed in #102148, let's update the branch. |
|
AST fuzzer (arm_asan_ubsan) #102462 Stateless tests (amd_binary, flaky check) Test runs too long (> 180s) |
LLVM Coverage Report
Changed lines: 100.00% (8/8) · Uncovered code |
When processing Parquet files with bloom filter push down enabled, empty IN/NOT IN clauses can cause an assertion failure.
CI Report:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=94140&sha=7fe6f50be1ff4259ae0673f2827b8de691661827&name_0=PR&name_1=Stress%20test%20%28amd_debug%29
#94140
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix assertion failure in Parquet bloom filter push down when using empty IN/NOT IN clauses.
Version info
26.4.1.947