Skip to content

Add test: system.parts_columns.estimates.null_count column values not verified - #104497

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
clickgapai:qa-bot/coverage-pr102356
May 10, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
clickgapai:qa-bot/coverage-pr102356

Conversation

@clickgapai

@clickgapai clickgapai commented May 9, 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 #102356.
That PR This PR adds NullCount statistics type for tracking NULL values in Nullable columns. Changes include: (1) New StatisticsNullCount class in StatisticsNullCount.cpp/h for counting NULLs, (2) Integration with ConditionSelectivityEstimator for IS NULL/IS NOT NULL predicate estimation, (3) Ne

1. system.parts_columns.estimates.null_count column values not verified
src/Storages/System/StorageSystemPartsColumns.cpp:327
Risk: StorageSystemPartsColumns.cpp:327-329 populates estimates.null_count from NullCount statistics. Risk: if the value extraction is broken (wrong statistics type cast, incorrect field access), user
What's unique vs PR tests: PR test 03625_auto_statistics.sql queries estimates.cardinality/min/max but NOT estimates.null_count. PR test 04063_statistics_null_count_prewhere.sql tests prewhere ordering via EXPLAIN but never que
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.5.1.491

@clickgapai

Copy link
Copy Markdown
Contributor Author

Pre-PR Validation Gate (per ClickGap pipeline):

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

b) Root cause explained? ✅
StorageSystemPartsColumns.cpp:327-331 — code to display estimates.null_count is added but zero tests query the column to verify correctness.

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: 04212_statistics_null_count_estimate.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.

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label May 9, 2026
@clickhouse-gh

clickhouse-gh Bot commented May 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [92b9e2a]

Summary: ✅


AI Review

Summary

This PR adds a focused stateless regression test for system.parts_columns.estimates.null_count using a controlled NULL distribution and verifies both the registered statistics types and extracted null-count estimates. I did not find correctness, safety, or maintainability problems in the new test coverage, and the change scope is clean and appropriate for a test-only PR.

ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ✅
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-not-for-changelog This PR should not be mentioned in the changelog submodule changed At least one submodule changed in this PR. labels May 9, 2026
Comment thread contrib/dragonbox Resolved
@clickgapai clickgapai closed this May 9, 2026
@zlareb1

zlareb1 commented May 9, 2026

Copy link
Copy Markdown
Member

@clickgapai why have you closed this PR?

@zlareb1 zlareb1 reopened this May 10, 2026
@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label May 10, 2026
@clickgapai
clickgapai force-pushed the qa-bot/coverage-pr102356 branch from f5c08bb to 92b9e2a Compare May 10, 2026 05:39
@alexey-milovidov alexey-milovidov self-assigned this May 10, 2026
@alexey-milovidov alexey-milovidov removed submodule changed At least one submodule changed in this PR. manual approve Manual approve required to run CI labels May 10, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

Good test, thank you!

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue May 10, 2026
Merged via the queue into ClickHouse:master with commit 0c3981e May 10, 2026
165 checks passed
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 10, 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-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