Skip to content

Add test: Direct reads of RIGHT-kind Join engine tables with ANY/SEMI/ANTI strictness (fillAll dispatch) untested - #109603

Merged
harikrishnan94 merged 2 commits into
ClickHouse:masterfrom
clickgapai:qa-bot/coverage-pr107189
Jul 7, 2026
Merged

harikrishnan94 merged 2 commits into
ClickHouse:masterfrom
clickgapai:qa-bot/coverage-pr107189

Conversation

@clickgapai

@clickgapai clickgapai commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.

This is a test-only PR — no source code changes. Please review: test quality, whether the claimed coverage gaps are real, and whether test output makes sense.

Adds test coverage for 1 untested code path(s), found during automated review of PR #107189.
PR replaces the pointer-based RowRef/RowRefList hash-join build-side cell representation with a compact 8-byte index-based encoding: cells hold {block_no, row_no} and a per-join StoredColumnsIndex resolves block_no to the stored block. All map variants, join kinds and strictnesses are affe

1. Direct reads of RIGHT-kind Join engine tables with ANY/SEMI/ANTI strictness (fillAll dispatch) untested
src/Storages/StorageJoin.cpp:869, src/Storages/StorageJoin.cpp:876
Risk: StorageJoin.cpp:869/876/883 select fillAll (not fillOne) for KIND == JoinKind::Right under Any/Semi/Anti strictness; fillAll walks it->getMapped().begin() and resolves each ref via the new index-based refWordBlockNo/refWordRowNo. Risk: if the dispatch or block resolution is broken, a direct read of such a table silently returns wrong rows (missing duplicates or reading the wrong stored column) — wrong results with no error.
What's unique vs PR tests: The PR's own 04402_storage_join_emit_non_first_column.sql covers ANY LEFT and ALL INNER direct reads; it never creates a RIGHT-kind Join engine table nor exercises the ANY/SEMI/ANTI + RIGHT fillAll dispatch that this test targets.
Try it on ClickHouse Fiddle

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):

Not applicable — test-only change.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.7.1.612 (included in 26.7 and later)

@clickgapai

Copy link
Copy Markdown
Contributor Author

Pre-PR Validation Gate (per ClickGap pipeline):

a) Deterministic repro? ✅
Test exercises the previously-uncovered branch and passes (correct behaviour).

b) Root cause explained? ✅
src/Storages/StorageJoin.cpp:869 (Any+Right), :876 (Semi+Right), :883 (Anti+Right) fillAll<Map>(...) dispatch branches are correct but executed by no test (LLVM-confirmed uncovered).

c) Fix matches root cause? ✅
N/A for coverage gap — this PR adds a regression test, not a fix. Asserts current correct behaviour at the cited line.

d) Test intent preserved? / New tests added? ✅
New regression test added: 04507_storage_join_right_direct_read.sql.

e) Both directions demonstrated? ✅
Test passes (MATCH) on master proving current correctness; would fail if the cited branch regressed. Single-direction is the correct shape for a coverage gap test.

f) Fix is general, not a narrow patch? ✅
Test asserts the invariant at the cited line — covers the branch, not a specific input shape.

@PedroTadim PedroTadim added the can be tested Allows running workflows for external contributors label Jul 7, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d2c290b]

Summary: ❌

job_name test_name status info comment
Stateless tests (arm_binary, parallel) FAIL
04061_spilling_hash_join_overflow_limits FAIL cidb, issue

AI Review

Summary

This PR adds a stateless regression test for direct reads from RIGHT-kind Join engine tables under ANY/SEMI/ANTI. The current version now splits inserts so the StorageJoin read path resolves refs across multiple stored blocks, which closes the only substantive coverage gap I saw; I found no remaining review findings in the current diff.

Final Verdict

✅ No findings.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 7, 2026
Single INSERT VALUES kept every ref in block_no=0; per-INSERT rows force
fillAll direct reads to resolve {block_no,row_no} across blocks 0..2.

Requested by @clickhouse-gh[bot] in ClickHouse#109603 (comment)
@harikrishnan94 harikrishnan94 self-assigned this Jul 7, 2026

@harikrishnan94 harikrishnan94 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test only changes.
LGTM.

@clickhouse-gh

clickhouse-gh Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.94% 85.95% +0.01%
Functions 91.47% 91.47% +0.00%
Branches 78.41% 78.44% +0.03%

Changed lines: No C/C++ source files changed — skipping uncovered code analysis.

Newly covered by added/modified tests: 87 line(s), 4 function(s) across 39 file(s) · Details

Top files
  • src/Storages/MergeTree/DataPartStorageOnDiskBase.cpp: 8 line(s)
  • src/Columns/ColumnObject.cpp: 5 line(s)
  • src/Functions/flipCoordinates.cpp: 5 line(s)
  • src/Functions/format.cpp: 5 line(s)
  • src/Storages/System/StorageSystemRoleGrants.cpp: 5 line(s)

Full report

@harikrishnan94
harikrishnan94 added this pull request to the merge queue Jul 7, 2026
Merged via the queue into ClickHouse:master with commit 63e4476 Jul 7, 2026
173 of 175 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 7, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
Single INSERT VALUES kept every ref in block_no=0; per-INSERT rows force
fillAll direct reads to resolve {block_no,row_no} across blocks 0..2.

Requested by @clickhouse-gh[bot] in ClickHouse#109603 (comment)
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…pr107189

Add test: Direct reads of RIGHT-kind `Join` engine tables with `ANY`/`SEMI`/`ANTI` strictness (`fillAll` dispatch) untested
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-not-for-changelog This PR should not be mentioned in the changelog 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.

4 participants