Repository navigation
Fix flaky 04217_array_concat_json_extract_keys_index under bucketed Map serialization - #104629
Conversation
…ap serialization
The test outputs three `Map(LowCardinality(String), String)` columns with
`SELECT *`. When CI randomizes
`map_serialization_version_for_zero_level_parts = 'with_buckets'` together
with `map_buckets_strategy = 'constant'` and a small
`map_buckets_min_avg_size`, `Map` entries are written to disk grouped by
hash bucket, so the iteration order reflects bucket order rather than
insertion order and the second column (`resource`) prints as
`{'job':'g','d':'e'}` instead of `{'d':'e','job':'g'}`.
Fix by wrapping each `Map` column in `mapSort` so the rendered output is
deterministic regardless of the underlying on-disk format. This is the
same idiomatic fix used in
`04060_coalescing_merge_tree_array_tuple_with_column_param.sql`. The test
still exercises every randomized serialization configuration: only the
`SELECT` output is sorted, the `WHERE` clause and the
`arrayConcat(mapKeys(...))` index path that the test was added to cover
(issue ClickHouse#88558 / PR ClickHouse#94515) are untouched.
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104473
Pre-PR validation
Session: cron:clickhouse-ci-task-worker:20260511-181500 |
|
cc @alexey-milovidov @Avogar — could you review this? It pins the rendered output of the three Per @alexey-milovidov's directive on #104473 (comment). |
|
Workflow [PR], commit [1885ec6] Summary: ❌
AI ReviewSummaryThis PR makes ClickHouse Rules
Final Verdict
|
d47ca00
The stateless test
04217_array_concat_json_extract_keys_indexfails on CI when the runner randomizesmap_serialization_version_for_zero_level_parts = 'with_buckets'together withmap_buckets_strategy = 'constant'and a smallmap_buckets_min_avg_size(observed culprit settings reported by--diagnose-random-settingson PR #104473 and PR #103016).Under
with_bucketsserialization,Mapentries are written to disk grouped by hash bucket, so iteration order duringSELECTreflects bucket order rather than insertion order. The test's last query prints threeMap(LowCardinality(String), String)columns viaSELECT *, and theresourcecolumn shows up as{'job':'g','d':'e'}instead of{'d':'e','job':'g'}.Fix by wrapping each
Mapcolumn inmapSortso the rendered output is deterministic regardless of the underlying on-disk format. This is the idiomatic pattern used in04060_coalescing_merge_tree_array_tuple_with_column_param.sql. The test still exercises every randomized serialization configuration — only theSELECToutput is sorted, theWHEREclause and thearrayConcat(mapKeys(...))index path that the test was originally added to cover (issue #88558 / PR #94515) are untouched.Verified locally:
.sql+ bucketed settings (with_buckets+constant+min_avg_size=1):resourcecolumn reorders, output differs from reference..sql+ same bucketed settings:mapSortproduces{'d':'e','job':'g'}stably..sqlunder the test runner with full randomization, 50/50 passes.CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104473
Related PR comment: #104473 (comment)
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
Version info
26.5.1.610