Skip to content

Add tests for compareTrackAt coverage in partial_merge join (PR #99013) - #99706

Closed
zlareb1 wants to merge 2 commits into
ClickHouse:masterfrom
zlareb1:qa/pr99013-comparetrackat-coverage
Closed

zlareb1 wants to merge 2 commits into
ClickHouse:masterfrom
zlareb1:qa/pr99013-comparetrackat-coverage

Conversation

@zlareb1

@zlareb1 zlareb1 commented Mar 17, 2026 •

Copy link
Copy Markdown
Member

This PR adds tests for the coverage gaps identified in PR #99013, which introduced IColumn::compareTrackAt for devirtualized multi-row skipping in partial_merge join.

04042_partial_merge_join_float_nan
Exercises ColumnVector<Float64>::compareTrackAt (ColumnVector.h:157) with Float64 join keys including NaN, Inf, and -Inf. No existing test in the suite used floating-point keys with partial_merge join. Verifies that NaN matches NaN under merge-join sort semantics and that track-skipping works correctly for all floating-point special values.

04043_partial_merge_join_multikey_track
Exercises MergeJoin.cpp:327-340: compareTrackAt on the first sort key returns track > 1 for runs of left-side rows strictly less than the right cursor, then nextN(-cmp) skips them at once. Secondary keys fall back to regular compareAt. Verifies that multi-row first-key skipping does not accidentally miss valid (key1, key2) matches.

Created with Claude.

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

PR ClickHouse#99013 added `IColumn::compareTrackAt` for devirtualized multi-row
skipping in partial-merge join. Two coverage gaps filled:

1. `04042_partial_merge_join_float_nan`: exercises
   `ColumnVector<Float64>::compareTrackAt` (ColumnVector.h:157) with
   `NaN`/`Inf` keys in `partial_merge` join. Verifies that `NaN` matches
   `NaN` (merge-join semantics: `compareAt` returns 0 for equal sort
   positions) and that track-skipping works correctly for floating-point
   keys including negative infinity.

2. `04043_partial_merge_join_multikey_track`: exercises
   `MergeJoin.cpp:327-340` — `compareTrackAt` on the first sort key
   forces `track > 1` on left runs that are strictly less than the right
   cursor; secondary keys then use regular `compareAt`. Verifies that
   multi-row skipping on key1 does not accidentally skip valid (key1,
   key2) matches.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [679e133]

Summary: ✅


AI Review

Summary

This PR adds two new stateless tests (04042_partial_merge_join_float_nan, 04043_partial_merge_join_multikey_track) to improve partial_merge join coverage around compareTrackAt, including floating-point edge cases (NaN, Inf) and multi-key skip behavior. The changes are test-only, focused, and consistent with the stated goal.

ClickHouse Rules

Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsHistory.cpp ➖
Safe rollout ✅
Compilation time ✅

Final Verdict

  • Status: ✅ Approve

@zlareb1 zlareb1 added the pr-not-for-changelog This PR should not be mentioned in the changelog label Mar 17, 2026
@clickhouse-gh

clickhouse-gh Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Dear @zlareb1, this PR hasn't been updated for a while. Will you continue working on it? If not, please close it. Otherwise, ignore this message.

@zlareb1

zlareb1 commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

@groeneai check if these tests are required. If yes, open a new PR.

@groeneai

Copy link
Copy Markdown
Collaborator

Yes, these are still uncovered. Reopened as #110646 (renumbered to 04546/04547 since 04042/04043 are now taken on master). The Float/NaN test now pins NaN rows last via isNaN() in the ORDER BY so it's deterministic under randomized nan_direction_hint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants