Skip to content

Revert "Text index postprocessor" - #108456

Merged
Ergus merged 1 commit into
masterfrom
revert-98939-text_index_postprocessor
Jun 25, 2026
Merged

Ergus merged 1 commit into
masterfrom
revert-98939-text_index_postprocessor

Conversation

@Ergus

@Ergus Ergus commented Jun 25, 2026 •

Copy link
Copy Markdown
Member

Reverts #98939

Version info

  • Merged into: 26.7.1.75
  • Backported to: 26.6.1.1193

@clickhouse-gh

clickhouse-gh Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [208ee06]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_tsan, s3 storage, parallel, 2/2) ERROR IGNORED

AI Review

Summary

This PR reverts Text index postprocessor and removes the associated implementation, documentation, and tests. The revert leaves one correctness regression in the text-index direct-read path: empty hasAnyTokens/hasAllTokens searches can become always-true virtual columns when another predicate keeps the granule alive.

Findings

❌ Blockers

  • [src/Storages/MergeTree/MergeTreeReaderTextIndex.cpp:289] Removing the explicit no-match handling for empty hasAnyTokens/hasAllTokens queries violates the row-level contract that an empty search-token set returns 0. In direct-read mode, a query such as WHERE id = 1 OR hasAnyTokens(message, '') can keep the mark alive via id = 1; then classifyVirtualColumns fills the text-index virtual column with 1, so the OR can return every row instead of only id = 1. Keep empty hasAnyTokens/hasAllTokens search queries as zero/no-match virtual columns here and in the lazy fill path.
Tests
  • ⚠️ Add a focused stateless regression with query_plan_direct_read_from_text_index = 1 where an empty hasAnyTokens/hasAllTokens predicate is under OR with a non-index predicate, so granule pruning cannot hide the virtual-column value. Cover the lazy apply mode as well if that path is enabled for the test setup.
Final Verdict

Status: ❌ Block

Minimum required actions: restore the zero/no-match handling for empty hasAnyTokens/hasAllTokens direct-read virtual columns and add the focused regression above.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jun 25, 2026
continue;

/// Always return true for empty needles.
is_always_true[i] = true;

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.

Empty token sets are not only a postprocessor case. hasAnyTokens and hasAllTokens also produce tokens.empty() for plain empty needles (for example hasAnyTokens(message, '')), and the row-level function returns 0 when search_tokens.empty(). With this branch removed, the direct-read virtual column is filled with 1 here. A query such as WHERE id = 1 OR hasAnyTokens(message, '') keeps the granule alive via id = 1, then this virtual column makes the OR true for every row instead of only id = 1. Please keep empty hasAnyTokens/hasAllTokens queries as explicit no-match columns here and in the lazy fill path below.

@clickhouse-gh

clickhouse-gh Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.40% 85.40% +0.00%
Functions 92.60% 92.60% +0.00%
Branches 77.60% 77.60% +0.00%

Changed lines: Changed C/C++ lines covered by tests: 282/295 (95.59%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 15 line(s) · Uncovered code

Full report · Diff report

@rschu1ze rschu1ze self-assigned this Jun 25, 2026
@Ergus
Ergus added this pull request to the merge queue Jun 25, 2026
@Ergus
Ergus removed this pull request from the merge queue due to a manual request Jun 25, 2026
@Ergus
Ergus added this pull request to the merge queue Jun 25, 2026
Merged via the queue into master with commit 2422fc0 Jun 25, 2026
165 of 167 checks passed
@Ergus
Ergus deleted the revert-98939-text_index_postprocessor branch June 25, 2026 16:46
robot-clickhouse-ci-2 added a commit that referenced this pull request Jun 25, 2026
Cherry pick #108456 to 26.6: Revert "Text index postprocessor"
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 25, 2026
@robot-clickhouse robot-clickhouse added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Jun 25, 2026
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jun 25, 2026
alexey-milovidov added a commit that referenced this pull request Jun 25, 2026
Backport #108456 to 26.6: Revert "Text index postprocessor"
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…t_index_postprocessor

Revert "Text index postprocessor"
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-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR 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 v26.6-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants