Repository navigation
Keep 05339_string_filters_during_scan_parquet_short_dictionary_values on the filtered dictionary read path - #126384
Conversation
Since ClickHouse#124131, the only input of the last PREWHERE step on a dictionary-encoded Parquet `String` column is read as dictionary indexes when no earlier step reads it (`decode_dictionary_as_replicated`), and its dictionary values come from `Reader::getDictionaryValues` with `use_string_value_filter = false`. So a single-column `PREWHERE s LIKE '%R%'` no longer passes through `StringValueFilter` and `StringValueFilterValuesReplaced` stays 0, which made the last line of 05339 print 0 on every master run since d64fd50. ClickHouse#124131 adapted 05055 for the same reason (32e261a), but 05339 was added by ClickHouse#124507 after ClickHouse#124131's last CI run, so it was never adapted. Add the same always-true conjunct `AND id < 100000` to the three PREWHERE queries: the conjunct order is kept, so `s` is read by the first of two steps and goes through the masked `Dictionary::appendIndexes` path the test checks. It goes on the two `apply_string_filters_during_scan = 0/1` comparison queries too, because with the single-column shape both arms read indexes and the comparison compared nothing. The reference does not change. Validated on a debug build of d64fd50: the old test fails 6/6, the new one passes 50/50 randomized (66667 replaced, 0 rows read as indexes). Reporting the mask lookups through `updateStats` instead of `updateStatsWithoutPerValueChecks` makes the new test fail 8/8 (5712-6384 replaced). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding; bounded: 1 full pass + 1 fix round + 1 delta recheck).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261016-231100 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261016-225500 |
|
Workflow [PR], commit [7959cad] AI ReviewSummaryAdds the always-true Missing context / blind spots
Final Verdict✅ Approve. |
|
cc @alexey-milovidov, could you review this and add |
Related: #124131
Related: #124507
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required.
Description
05339_string_filters_during_scan_parquet_short_dictionary_valuesfails on every master run since the merge of #124131 (master report), with and without randomized settings, and on every PR whose merge commit includes it. Only the last line differs:StringValueFilterValuesReplacedis 0.Since #124131, a single-column last PREWHERE step on a dictionary-encoded Parquet column evaluates its functions once per dictionary value and reads the rows as indexes. The dictionary values are read without the string filter, so the filter reports nothing. The test's
PREWHERE s LIKE '%R%'has exactly that shape. #124131 adapted the sibling05055_string_filters_during_scan_parquet.shfor the same reason, but this test came with #124507 after #124131's last CI run.The change adds the same always-true conjunct
AND id < 100000to the test's three PREWHERE queries, sosis read by an earlier step, through the masked dictionary path the test checks. Without it theapply_string_filters_during_scan = 0/1comparison also compared nothing. The reference is unchanged.Validation on a debug build of
d64fd503b42e: the old test fails 6 of 6 runs. The new one passes 50 of 50 randomized runs, with 66667 values replaced and 0 rows read as indexes in each. WithDictionary::appendIndexesreporting its mask lookups throughupdateStatsinstead ofupdateStatsWithoutPerValueChecks, the new test fails 8 of 8 (5712-6384 replaced), so it still catches the regression it was written for.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/126384]