Skip to content

Add 02346_text_index_edge_cases: edge cases for text index push-down - #107385

Merged
alexbakharew merged 1 commit into
masterfrom
abakharew/text-index-not-used-extra
Jun 26, 2026
Merged

alexbakharew merged 1 commit into
masterfrom
abakharew/text-index-not-used-extra

Conversation

@alexbakharew

@alexbakharew alexbakharew commented Jun 13, 2026 •

Copy link
Copy Markdown
Contributor

Sanity checks around predicate shapes the text index cannot service, grouped with other text index tests as 02346_text_index_edge_cases.

Three cases are covered, all checked via force_data_skipping_indices='idx_message':

  1. equals(message, '') / message == '' - tokenizing '' yields no tokens, so the text index has no required token to look up. INDEX_NOT_USED must be raised. Exercised with optimize_empty_string_comparisons = 1 so the optimizer rewrite path is covered too.

  2. match(message, 'v[0-9]+\.[0-9]+') - the regex has no complete required token to push down (the leading v is shorter than the alphanumeric boundary), so the match() codepath declines the index and INDEX_NOT_USED is raised.

  3. Positive sanity counterparts: match(message, ' release ') and equals(message, 'beta version') both have a complete required token, so the index applies normally.

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

...

Version info

  • Merged into: 26.7.1.122

@clickhouse-gh

clickhouse-gh Bot commented Jun 13, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a2498d3]

Summary: ✅


AI Review

Summary

This PR adds a stateless regression test for text index predicates that must raise INDEX_NOT_USED when force_data_skipping_indices is used, plus positive sanity checks for predicates that should still use the index. The current PR diff is back to the intended two test files and the PR metadata matches that scope, but the new test is still excluded from the fast gate.

Findings

⚠️ Majors

  • [tests/queries/0_stateless/02346_text_index_edge_cases.sql:1] The new regression test remains tagged no-fasttest, so the fast gate skips the exact text index edge-case coverage this PR adds. This file only creates a two-row MergeTree table and comparable text index stateless tests run without this tag, so the exclusion needs a concrete fasttest limitation or should be removed.
    Suggested fix: remove -- Tags: no-fasttest.
Final Verdict

Status: ⚠️ Request changes

Minimum required action: remove the unjustified no-fasttest tag, or document the specific fasttest limitation that requires skipping this test there.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jun 13, 2026
@@ -0,0 +1,46 @@
-- Tags: no-fasttest

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.

Please don’t tag this no-fasttest unless it depends on something fasttest lacks or is too slow there. This is a tiny two-row stateless regression, and comparable text index tests such as 02346_text_index_match_predicate.sql run without this tag, so keeping it means the coverage this PR adds is skipped in the fast gate.

@rschu1ze rschu1ze self-assigned this Jun 22, 2026
@alexbakharew

This comment was marked as resolved.

@rschu1ze

This comment was marked as resolved.

@rschu1ze

This comment was marked as resolved.

@alexbakharew alexbakharew changed the title Add 04218_text_index_not_used_extra: edge cases for text index push-down Add 02346_text_index_edge_cases: edge cases for text index push-down Jun 24, 2026
@clickhouse-gh clickhouse-gh Bot added pr-not-for-changelog This PR should not be mentioned in the changelog and removed pr-ci labels Jun 24, 2026
@alexbakharew
alexbakharew marked this pull request as ready for review June 24, 2026 14:31
Comment thread ci/jobs/llvm_coverage_job.py Resolved
Comment thread ci/jobs/llvm_coverage_job.py Resolved
@rschu1ze

Copy link
Copy Markdown
Member

@alexbakharew Sure you want to push the various CI scripts with this innocent little test PR?

@alexbakharew

Copy link
Copy Markdown
Contributor Author

@rschu1ze no, I do some experiments with LLVM Coverage.

I will revert all unrelated changes and merge it finally later today

Tests `equals()` predicate push-down to text indexes including empty
string handling (`optimize_empty_string_comparisons` setting).

Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
@alexbakharew
alexbakharew force-pushed the abakharew/text-index-not-used-extra branch from 6378408 to a2498d3 Compare June 26, 2026 18:05
@clickhouse-gh

clickhouse-gh Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

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

Changed lines: No C/C++ source files changed — skipping uncovered code analysis.

Newly covered by added/modified tests: 397 line(s), 57 function(s) across 136 file(s) · Details

Top files
  • src/Common/ZooKeeper/ZooKeeper.cpp: 16 line(s), 2 function(s)
  • src/AggregateFunctions/TimeSeries/AggregateFunctionTimeseriesChanges.h: 14 line(s), 32 function(s)
  • src/AggregateFunctions/AggregateFunctionQuantileGK.cpp: 14 line(s)
  • src/Storages/StorageReplicatedMergeTree.cpp: 14 line(s)
  • src/Databases/DatabaseFactory.cpp: 11 line(s)

Full report

@alexbakharew
alexbakharew added this pull request to the merge queue Jun 26, 2026
Merged via the queue into master with commit d1255a7 Jun 26, 2026
169 checks passed
@alexbakharew
alexbakharew deleted the abakharew/text-index-not-used-extra branch June 26, 2026 21:53
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