compareTrackAt() in partial_merge_join for nullables#100945
Conversation
|
Tested with TPC-H witt all columns changed to Nullables.
before after I have not test it with reall nullable data yet. Only with Nullable columns with 0 nulls inside. |
|
Please label it as a performance improvement. |
|
Workflow [PR], commit [f6069ad] Summary: ✅ AI ReviewSummaryThis PR improves nullable-key handling in Findings
Tests
ClickHouse Rules
Final Verdict
|
|
Add check for null-tracks. AI should be happy :) |
| @@ -406,7 +459,7 @@ void makeSortAndMerge(const Names & keys, SortDescription & sort, SortDescriptio | |||
| if (!unique_keys.contains(key_name)) | |||
There was a problem hiding this comment.
This change flips partial_merge_join key ordering to nulls_direction = -1 and rewrites nullableCompareAt/nullableCompareTrackAt semantics for nullable keys. Please add a regression test in tests/queries/0_stateless that covers nullable join keys across both streams (including runs of NULL, mixed NULL/non-NULL, and cross-block continuation) to lock in cursor advancement behavior.
Without such coverage, future refactors around compareTrackAt can easily reintroduce subtle mis-ordering/skip bugs.
There was a problem hiding this comment.
I need get and improve these ones #99706
There was a problem hiding this comment.
Thanks for the update. This thread is still live: the PR changes nullableCompareAt/nullableCompareTrackAt behavior and nulls_direction in partial_merge_join, but there is still no regression test in this PR that locks cursor advancement with nullable keys.
The pointer to #99706 does not resolve this PR by itself, because nothing in the current diff adds coverage for:
- runs of
NULLon both sides, - mixed
NULL/non-NULLboundaries, - continuation across right-block boundaries (
left_key_tail/skippaths).
Please add a focused tests/queries/0_stateless test for these cases in this PR.
There was a problem hiding this comment.
The concern is still open in the current HEAD: this PR changes nullable cursor movement in nullableCompareAt, nullableCompareTrackAt, and null ordering in makeSortAndMerge, but still does not add a regression test under tests/queries/0_stateless.
Please add one focused test that validates partial-merge behavior for nullable join keys across:
- runs of
NULLon both sides, NULL/non-NULLboundaries,- continuation across right-block boundaries (
left_key_tail/skippath with small block limits).
There was a problem hiding this comment.
The issue is still present in the current HEAD: this PR changes nullable-key cursor logic (nullableCompareAt, nullableCompareTrackAt, and makeSortAndMerge ordering), but it still does not add a dedicated tests/queries/0_stateless regression test for partial-merge joins on nullable keys.
The previous reply points to #99706, but there is still no coverage in this PR for:
- runs of
NULLkeys on both sides, NULL/non-NULLboundary transitions,- continuation paths across right-block boundaries (
left_key_tail/skipbehavior).
Please add one focused stateless test in this PR to lock this behavior.
|
Ryzen 7840HS Before (26.4.2.10) After Default HashJoin (slower!) |
LLVM Coverage Report
Changed lines: 100.00% (101/101) · Uncovered code |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
perf improvement in partial_merge_join
Missing part of #99013