Skip to content

Enable join fixed hash table with mismatched key types - #111244

Merged
m-selmi merged 8 commits into
ClickHouse:masterfrom
m-selmi:improve-join-fix-hash-table-usage
Aug 11, 2026
Merged

m-selmi merged 8 commits into
ClickHouse:masterfrom
m-selmi:improve-join-fix-hash-table-usage

Conversation

@m-selmi

@m-selmi m-selmi commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

The shared runtime filter descriptors record the build-side key column name at plan optimization time, but when the probe and build key types differ (e.g. a Nullable probe key and a non-Nullable build key, or keys of different widths), the build key is later cast to the common type and renamed (_CAST(k, 'Nullable(Int32)')), so HashJoin::publishSharedRuntimeFilters never matched the descriptor and the Set/BloomFilter was never replaced with the fixed hash table.

Changelog category (leave one):

  • Performance Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Enable join_runtime_filter_from_fixed_hash_table when the probe and build join key types differ (for example, a Nullable probe key with a non-Nullable build key).

Version info

  • Merged into: 26.8.1.1157 (included in 26.8 and later)

@m-selmi m-selmi added the can be tested Allows running workflows for external contributors label Jul 21, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [c5b2eaa]

Summary: ✅


AI Review

Summary

This PR updates JoinStepLogical so shared runtime-filter descriptors follow the build-side key rename when predicateOperandsToCommonType inserts a cast, and adds a regression test that proves the shared fixed-hash-table runtime filter is actually published for mismatched key types. After reviewing the current diff, the surrounding join/runtime-filter paths, the prior review threads, and the current all-green Praktika run, I did not find a remaining correctness or coverage issue in the current code.

Final Verdict

✅ No blocking issues found.

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.70% 86.60% -0.10%
Functions 91.90% 91.80% -0.10%
Branches 78.90% 78.90% +0.00%

Changed lines: Changed C/C++ lines covered: 50/50 (100.00%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-performance Pull request with some performance improvements label Jul 21, 2026
Comment thread src/Interpreters/SpillingHashJoin.cpp Resolved
@m-selmi
m-selmi marked this pull request as ready for review July 23, 2026 15:57
@clickhouse-gh

clickhouse-gh Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 37 queries analysed

no significant changes detected. K_source=6 K_base=30 flagged=0/65

clickbench

🟢 No significant changes

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: e46318c8-8423-4e8a-b606-27efe62f0311
  • MIRAI run: 893303f6-5568-4a5f-b6ab-731318c43135
  • PR check IDs:
    • clickbench_581358_1786362822
    • clickbench_581372_1786362822
    • clickbench_581384_1786362822
    • tpch_adapted_1_official_581390_1786362822
    • tpch_adapted_1_official_581414_1786362822
    • tpch_adapted_1_official_581428_1786362822

@clickhouse-gh

clickhouse-gh Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.20% 86.20% +0.00%
Functions 92.00% 92.00% +0.00%
Branches 78.30% 78.30% +0.00%

Changed lines: Changed C/C++ lines covered: 51/51 (100.00%) · Uncovered code

Full report · Diff report

@m-selmi m-selmi changed the title Enable join fixed hash table under spilling wrapper and with mismatched key types Enable join fixed hash table with mismatched key types Aug 10, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing c5b2eaaff with master 5e52a0f26 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of b9d4064cb; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 690.92 MiB 687.90 MiB -3.03 MiB (-0.44%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

7 translation units recompiled, 21 s compile time in total, 7 of them have a recent master baseline.

Job report

@m-selmi
m-selmi added this pull request to the merge queue Aug 11, 2026
Merged via the queue into ClickHouse:master with commit d42ef2f Aug 11, 2026
529 of 531 checks passed
@m-selmi
m-selmi deleted the improve-join-fix-hash-table-usage branch August 11, 2026 09:05
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-performance Pull request with some performance improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants