Skip to content

Fix for NOT_FOUND_COLUMN_IN_BLOCK when selecting from projections#100623

Merged
Avogar merged 2 commits intomasterfrom
yarik/not-found-column-in-block-fix
Mar 25, 2026
Merged

Fix for NOT_FOUND_COLUMN_IN_BLOCK when selecting from projections#100623
Avogar merged 2 commits intomasterfrom
yarik/not-found-column-in-block-fix

Conversation

@yariks5s
Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

Fixes NOT_FOUND_COLUMN_IN_BLOCK cases where the projection SELECT part has columns that do not exist in the original SELECT part of the query. Closes #100194

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh Bot commented Mar 24, 2026

Workflow [PR], commit [684be9b]

Summary:


AI Review

Summary

This PR fixes a real correctness issue in projection optimization with row policies: projection-specific SelectQueryInfo now clears row_level_filter to avoid trying to evaluate row-policy actions against projection blocks that may not contain all source columns, while keeping effective filtering through the merged filter_actions_dag. The added stateless test covers both projection paths (DistinctStep and AggregatingStep) and reproduces the original NOT_FOUND_COLUMN_IN_BLOCK scenario. High-level verdict: the fix is targeted, consistent across normal and aggregate projection optimizations, and safe.

Missing context
  • ⚠️ No CI results/logs were provided in the review input, so this review is based on code and tests in the diff.
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
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Mar 24, 2026
@Avogar Avogar self-assigned this Mar 24, 2026
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh Bot commented Mar 25, 2026

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.10% 84.10% +0.00%
Functions 24.60% 24.50% -0.10%
Branches 76.70% 76.70% +0.00%

PR changed lines: PR changed-lines coverage: 100.00% (18/18, 0 noise lines excluded)
Diff coverage report
Uncovered code

@Avogar Avogar added this pull request to the merge queue Mar 25, 2026
Merged via the queue into master with commit d49e1a9 Mar 25, 2026
153 checks passed
@Avogar Avogar deleted the yarik/not-found-column-in-block-fix branch March 25, 2026 14:33
@yariks5s yariks5s added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Mar 25, 2026
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Mar 25, 2026
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Mar 25, 2026
robot-clickhouse added a commit that referenced this pull request Mar 25, 2026
robot-clickhouse added a commit that referenced this pull request Mar 25, 2026
robot-clickhouse added a commit that referenced this pull request Mar 25, 2026
robot-clickhouse added a commit that referenced this pull request Mar 25, 2026
robot-clickhouse added a commit that referenced this pull request Mar 25, 2026
clickhouse-gh Bot added a commit that referenced this pull request Mar 25, 2026
Backport #100623 to 26.2: Fix for NOT_FOUND_COLUMN_IN_BLOCK when selecting from projections
clickhouse-gh Bot added a commit that referenced this pull request Mar 25, 2026
Backport #100623 to 26.3: Fix for NOT_FOUND_COLUMN_IN_BLOCK when selecting from projections
@robot-ch-test-poll robot-ch-test-poll added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Mar 25, 2026
yariks5s added a commit that referenced this pull request Mar 26, 2026
Backport #100623 to 26.1: Fix for NOT_FOUND_COLUMN_IN_BLOCK when selecting from projections
clickhouse-gh Bot added a commit that referenced this pull request Mar 26, 2026
Backport #100623 to 25.12: Fix for NOT_FOUND_COLUMN_IN_BLOCK when selecting from projections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-bugfix Pull request with bugfix, not backported by default pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR 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.

NOT_FOUND_COLUMN_IN_BLOCK exception raised when selecting from table with row policy

5 participants