Skip to content

Backport #99504 to 25.12: Fix NOT_FOUND_COLUMN_IN_BLOCK when text index predicate is referenced in SELECT - #99631

Merged
clickhouse-gh[bot] merged 4 commits into
25.12from
backport/25.12/99504
Mar 19, 2026
Merged

clickhouse-gh[bot] merged 4 commits into
25.12from
backport/25.12/99504

Conversation

@robot-clickhouse-ci-1

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 commented Mar 16, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #99504
Cherry-pick pull-request #99617

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 25.12.9.51

…ndex predicate is referenced in SELECT
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default labels Mar 16, 2026
@clickhouse-gh

clickhouse-gh Bot commented Mar 16, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [860ab90]

Summary: ✅

alexey-milovidov and others added 3 commits March 17, 2026 03:19
…n text index predicate is referenced in SELECT"

This reverts commit 57801bd.
… optimization

The original backport brought the entire master version of `optimizeDirectReadFromTextIndex.cpp`
which depends on `Interpreters/ITokenizer.h` that doesn't exist on the 25.12 branch.

Instead, apply the minimal fix: when `replaceNodes` substitutes a text-search function node
with a virtual column input, add an alias to preserve the original column name. This ensures
downstream steps (e.g. ExpressionStep for SELECT) that reference the predicate by its original
name can still find it in the block.

#99631

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The backport of PR #99504 added an alias in replaceNodes() to preserve
original column names for downstream steps, fixing NOT_FOUND_COLUMN_IN_BLOCK.
This alias causes EXPLAIN to show original expression names instead of
__text_index_* virtual column names in Filter/Prewhere column output.

Update all affected tests to check for __text_index virtual column presence
in EXPLAIN actions output instead of checking Filter column names, matching
the approach used in the original master PR.

Also add missing SET allow_experimental_full_text_index = 1 to the new
04039_text_index_direct_read_select_alias test.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@clickhouse-gh
clickhouse-gh Bot merged commit 2b7d8a1 into 25.12 Mar 19, 2026
33 checks passed
@clickhouse-gh
clickhouse-gh Bot deleted the backport/25.12/99504 branch March 19, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants