Skip to content

Add test for text index PREWHERE with alias defined in SELECT - #99717

Merged
zlareb1 merged 4 commits into
ClickHouse:masterfrom
zlareb1:qa/pr99504-text-index-prewhere-alias-coverage
Mar 19, 2026
Merged

zlareb1 merged 4 commits into
ClickHouse:masterfrom
zlareb1:qa/pr99504-text-index-prewhere-alias-coverage

Conversation

@zlareb1

@zlareb1 zlareb1 commented Mar 17, 2026 •

Copy link
Copy Markdown
Member

Add a stateless test covering the fix from PR #99504, which resolved a NOT_FOUND_COLUMN_IN_BLOCK exception when query_plan_direct_read_from_text_index is enabled and a text-index predicate is used in PREWHERE via an alias defined in SELECT.

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

Not for changelog.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.3.1.876

Tests that `query_plan_direct_read_from_text_index` works correctly when
the text-index predicate is referenced via an alias in `SELECT` and used
in `PREWHERE`. PR ClickHouse#99504 fixed `NOT_FOUND_COLUMN_IN_BLOCK` for this pattern.

Covers: `hasToken`, `hasAllTokens`, `hasAnyTokens` with `PREWHERE` alias,
`PREWHERE + WHERE` combined, explicit `PREWHERE` predicate with alias in
`SELECT`, and `NOT` predicate with `PREWHERE` alias.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@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 Mar 17, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [6945364]

Summary: ✅


AI Review

Summary

This PR adds a new stateless regression test pair (04042_text_index_prewhere_alias_select.sql/.reference) for the PR #99504 fix, validating that text-index predicates used via aliases in SELECT work correctly in PREWHERE. I did not find correctness, safety, performance, or compliance issues in the proposed test coverage.

ClickHouse Rules

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

Final Verdict

  • Status: ✅ Approve

zlareb1 and others added 2 commits March 17, 2026 21:30
Text index is available in fasttest. Existing `02346_text_index_*` tests
carry no `no-fasttest` tag. The tag was added by mistake.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
query_plan_direct_read_from_text_index is incompatible with parallel
replicas (same reason as 02346_text_index_direct_read.sql). Also guard
the final DROP with IF EXISTS so re-runs after mid-test failure are clean.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@zlareb1
zlareb1 marked this pull request as ready for review March 19, 2026 11:04
04039_text_index_direct_read_select_alias.sql uses the same settings
(query_plan_direct_read_from_text_index, use_skip_indexes_on_data_read)
without the tag. The no-parallel-replicas concern in 02346 applies to
tests that assert read_rows metrics, not row output. This test only
checks result rows, so parallel replicas should not affect correctness.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@zlareb1
zlareb1 requested a review from CurtizJ March 19, 2026 11:13
@CurtizJ CurtizJ self-assigned this Mar 19, 2026
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 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.

3 participants