This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.2
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.2 by this push:
     new 4da65171fce [fix](branch-4-2) Repair index regression and BE unit 
tests (#68691)
4da65171fce is described below

commit 4da65171fced5235bd7da5d6514077890277e1f6
Author: Jack <[email protected]>
AuthorDate: Thu Oct 8 09:43:18 2026 +0800

    [fix](branch-4-2) Repair index regression and BE unit tests (#68691)
    
    ### What problem does this PR solve?
    
    Related PR: #68584, #68643
    
    Problem Summary:
    
    CI fuzzes `enable_common_expr_pushdown` and
    `enable_common_expr_pushdown_for_inverted_index` when a session starts.
    The gram and SNII regression suites require the inverted-index path, but
    did not pin those settings. When pushdown is disabled, their index
    profile assertions fail and `SEARCH` can be evaluated without its index
    context. The affected suites now enable both settings explicitly.
    
    The `SegmentIteratorApplyIndexExprTest` fixture now starts with
    candidate rows, so its seven failing cases reach index-expression
    evaluation. Master currently excludes this fixture from its BE UT build;
    branch-4.2 includes it. The three existing
    `FileCacheProfileReporterTest` failures on branch-4.2 are outside this
    PR.
    
    ### Release note
    
    None
    
    ### Check List (For Author)
    
    - Test
    - [x] Regression test: 16 selected gram/SNII suites passed in a local
    ASAN cloud cluster with both global pushdown defaults set to false.
    - [x] Unit Test: 11 `SegmentIteratorApplyIndexExprTest` cases passed
    under ASAN.
    
    - Behavior changed:
    - [x] Yes. The regression suites set the session values required by
    their index assertions; the segment iterator test fixture starts with
    candidate rows.
    
    - Does this need documentation?
        - [x] No.
    
    ### Check List (For Reviewer who merge this PR)
    
    - [ ] Confirm the release note
    - [ ] Confirm test cases
    - [ ] Confirm document
    - [ ] Add branch pick label
---
 be/test/storage/segment/segment_iterator_apply_index_expr_test.cpp      | 1 +
 .../suites/inverted_index_p0/gram/test_gram_compaction.groovy           | 2 ++
 .../suites/inverted_index_p0/gram/test_gram_index_order.groovy          | 2 ++
 .../suites/inverted_index_p0/gram/test_gram_metadata_inherit.groovy     | 2 ++
 .../suites/inverted_index_p0/gram/test_gram_pattern_recall.groovy       | 2 ++
 .../suites/inverted_index_p0/gram/test_gram_policy_recovery.groovy      | 2 ++
 .../suites/inverted_index_p0/gram/test_gram_regexp_like.groovy          | 2 ++
 .../suites/inverted_index_p0/gram/test_gram_schema_change.groovy        | 2 ++
 .../suites/inverted_index_p0/gram/test_gram_stop_gram.groovy            | 2 ++
 .../inverted_index_p0/storage_format/test_storage_format_snii.groovy    | 2 ++
 .../storage_format/test_storage_format_snii_custom_analyzer.groovy      | 2 ++
 .../storage_format/test_storage_format_snii_norms.groovy                | 2 ++
 .../storage_format/test_storage_format_snii_utf8_wildcard.groovy        | 2 ++
 .../suites/variant_p0/test_variant_search_subcolumn_snii.groovy         | 2 ++
 .../suites/variant_p0/v2/with_index/test_variant_v2_snii_index.groovy   | 2 ++
 .../suites/variant_p0/with_index/test_variant_snii_compaction.groovy    | 2 ++
 regression-test/suites/variant_p0/with_index/var_index_snii.groovy      | 2 ++
 17 files changed, 33 insertions(+)

diff --git a/be/test/storage/segment/segment_iterator_apply_index_expr_test.cpp 
b/be/test/storage/segment/segment_iterator_apply_index_expr_test.cpp
index 09d9f0e4a80..84d012e8ead 100644
--- a/be/test/storage/segment/segment_iterator_apply_index_expr_test.cpp
+++ b/be/test/storage/segment/segment_iterator_apply_index_expr_test.cpp
@@ -127,6 +127,7 @@ protected:
         }
         _read_schema = std::make_shared<Schema>(_tablet_schema->columns(), 
read_column_ids);
         _iter = std::make_unique<SegmentIterator>(_segment, _read_schema);
+        _iter->_row_bitmap.addRange(0, _segment->num_rows());
 
         // Set up RuntimeState with fallback enabled so 
_downgrade_without_index works
         TQueryOptions query_options;
diff --git 
a/regression-test/suites/inverted_index_p0/gram/test_gram_compaction.groovy 
b/regression-test/suites/inverted_index_p0/gram/test_gram_compaction.groovy
index 2b5014d655c..b8dc5db6ec5 100644
--- a/regression-test/suites/inverted_index_p0/gram/test_gram_compaction.groovy
+++ b/regression-test/suites/inverted_index_p0/gram/test_gram_compaction.groovy
@@ -18,6 +18,8 @@
 // Compaction rebuilds docs-only gram indexes from merged rows. Verify query 
results
 // and index availability before and after compaction.
 suite("test_gram_compaction", "p0") {
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     def waitAnalyzerInstalled = { String name ->
         def deadline = System.currentTimeMillis() + 180_000
         Exception lastNotFound = null
diff --git 
a/regression-test/suites/inverted_index_p0/gram/test_gram_index_order.groovy 
b/regression-test/suites/inverted_index_p0/gram/test_gram_index_order.groovy
index 244ae38ccf5..1aee562d70f 100644
--- a/regression-test/suites/inverted_index_p0/gram/test_gram_index_order.groovy
+++ b/regression-test/suites/inverted_index_p0/gram/test_gram_index_order.groovy
@@ -28,6 +28,8 @@ import org.apache.doris.regression.action.ProfileAction
 //      whichever tokenized index came first. A docs-only index in that place 
-- and a gram index
 //      is docs-only by default -- made a valid query fail.
 suite("test_gram_index_order", "p0") {
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     def sparseTok = "gram_order_sparse_tok"
     def sparseAna = "gram_order_sparse"
     def positionalAna = "gram_order_positional"
diff --git 
a/regression-test/suites/inverted_index_p0/gram/test_gram_metadata_inherit.groovy
 
b/regression-test/suites/inverted_index_p0/gram/test_gram_metadata_inherit.groovy
index fe64b4ecb97..59ce906ddfd 100644
--- 
a/regression-test/suites/inverted_index_p0/gram/test_gram_metadata_inherit.groovy
+++ 
b/regression-test/suites/inverted_index_p0/gram/test_gram_metadata_inherit.groovy
@@ -20,6 +20,8 @@ import java.util.regex.Pattern
 import org.apache.doris.regression.action.ProfileAction
 
 suite("test_gram_metadata_inherit", "p0") {
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     // Cloud does not support the named-index BUILD syntax used here. Keep 
this case scoped
     // to adding one requested index while IndexBuilder inherits the unchanged 
gram indexes.
     if (isCloudMode()) {
diff --git 
a/regression-test/suites/inverted_index_p0/gram/test_gram_pattern_recall.groovy 
b/regression-test/suites/inverted_index_p0/gram/test_gram_pattern_recall.groovy
index cfe90bfd16e..23918556be6 100644
--- 
a/regression-test/suites/inverted_index_p0/gram/test_gram_pattern_recall.groovy
+++ 
b/regression-test/suites/inverted_index_p0/gram/test_gram_pattern_recall.groovy
@@ -16,6 +16,8 @@
 // under the License.
 
 suite("test_gram_pattern_recall", "p0") {
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     sql "DROP INVERTED INDEX TOKENIZER IF EXISTS gram_recall_invalid_tokenizer"
     test {
         sql """CREATE INVERTED INDEX TOKENIZER gram_recall_invalid_tokenizer
diff --git 
a/regression-test/suites/inverted_index_p0/gram/test_gram_policy_recovery.groovy
 
b/regression-test/suites/inverted_index_p0/gram/test_gram_policy_recovery.groovy
index 6d9374db849..f254b843dea 100644
--- 
a/regression-test/suites/inverted_index_p0/gram/test_gram_policy_recovery.groovy
+++ 
b/regression-test/suites/inverted_index_p0/gram/test_gram_policy_recovery.groovy
@@ -16,6 +16,8 @@
 // under the License.
 
 suite("test_gram_policy_recovery", "p0") {
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     sql "SET enable_sql_cache=false"
     // The condition cache must be off too: gram deliberately keeps its LIKE / 
REGEXP expression
     // in _common_expr_ctxs_push_down for the row-level recheck, so the 
segment iterator never
diff --git 
a/regression-test/suites/inverted_index_p0/gram/test_gram_regexp_like.groovy 
b/regression-test/suites/inverted_index_p0/gram/test_gram_regexp_like.groovy
index 26b5bd3a6f4..469638a4b3e 100644
--- a/regression-test/suites/inverted_index_p0/gram/test_gram_regexp_like.groovy
+++ b/regression-test/suites/inverted_index_p0/gram/test_gram_regexp_like.groovy
@@ -22,6 +22,8 @@ import org.apache.doris.regression.action.ProfileAction
 // Compare LIKE and REGEXP results with and without gram index pushdown.
 // The original expression must still decide which candidate rows match.
 suite("test_gram_regexp_like", "p0") {
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     def tbl = "t_gram_regexp_like"
     // Policy names are globally unique: tokenizers and analyzers share one 
namespace, so the two
     // names must differ
diff --git 
a/regression-test/suites/inverted_index_p0/gram/test_gram_schema_change.groovy 
b/regression-test/suites/inverted_index_p0/gram/test_gram_schema_change.groovy
index 8cef9fc3d83..54cf16e66ea 100644
--- 
a/regression-test/suites/inverted_index_p0/gram/test_gram_schema_change.groovy
+++ 
b/regression-test/suites/inverted_index_p0/gram/test_gram_schema_change.groovy
@@ -22,6 +22,8 @@ import java.util.regex.Pattern
 // Check that gram indexes remain readable and useful after schema changes and 
new loads.
 // LIKE and REGEXP results must match a scan at every step.
 suite("test_gram_schema_change", "p0") {
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     def waitAnalyzerInstalled = { String name ->
         def deadline = System.currentTimeMillis() + 180_000
         Exception lastNotFound = null
diff --git 
a/regression-test/suites/inverted_index_p0/gram/test_gram_stop_gram.groovy 
b/regression-test/suites/inverted_index_p0/gram/test_gram_stop_gram.groovy
index a3f8c7b0cba..a16db778a9b 100644
--- a/regression-test/suites/inverted_index_p0/gram/test_gram_stop_gram.groovy
+++ b/regression-test/suites/inverted_index_p0/gram/test_gram_stop_gram.groovy
@@ -22,6 +22,8 @@ import java.util.regex.Pattern
 // Compare one large segment that drops common postings with smaller segments 
that keep them.
 // Both layouts must return the same LIKE and REGEXP results as a scan.
 suite("test_gram_stop_gram", "p0") {
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     def waitAnalyzerInstalled = { String name ->
         def deadline = System.currentTimeMillis() + 180_000
         Exception lastNotFound = null
diff --git 
a/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii.groovy
 
b/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii.groovy
index 5ada1cc5991..b4a3db04aec 100644
--- 
a/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii.groovy
+++ 
b/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii.groovy
@@ -16,6 +16,8 @@
 // under the License.
 
 suite("test_storage_format_snii", "p0, nonConcurrent") {
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     sql "DROP TABLE IF EXISTS test_storage_format_snii"
     sql "DROP TABLE IF EXISTS test_storage_format_snii_array"
     sql "DROP TABLE IF EXISTS test_storage_format_snii_add_index"
diff --git 
a/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii_custom_analyzer.groovy
 
b/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii_custom_analyzer.groovy
index b0c09e57c99..78ce558b7d3 100644
--- 
a/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii_custom_analyzer.groovy
+++ 
b/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii_custom_analyzer.groovy
@@ -16,6 +16,8 @@
 // under the License.
 
 suite("test_storage_format_snii_custom_analyzer", "p0,nonConcurrent") {
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     def charFilter = "doris_27738_char_filter"
     def basicAnalyzer = "doris_27738_basic_analyzer"
     def keywordAnalyzer = "doris_27738_keyword_analyzer"
diff --git 
a/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii_norms.groovy
 
b/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii_norms.groovy
index e8888a8d41b..697a4116d2a 100644
--- 
a/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii_norms.groovy
+++ 
b/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii_norms.groovy
@@ -24,6 +24,8 @@
 // is refused.
 // It flips a BE config, so it must not share the cluster with other suites.
 suite("test_storage_format_snii_norms", "p0,nonConcurrent") {
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     sql """ set enable_match_without_inverted_index = false """
     sql """ set default_variant_enable_typed_paths_to_sparse = false """
     sql """ set default_variant_enable_doc_mode = false """
diff --git 
a/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii_utf8_wildcard.groovy
 
b/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii_utf8_wildcard.groovy
index f069ea44c32..b0acf1ab21d 100644
--- 
a/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii_utf8_wildcard.groovy
+++ 
b/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_snii_utf8_wildcard.groovy
@@ -16,6 +16,8 @@
 // under the License.
 
 suite("test_storage_format_snii_utf8_wildcard", "p0, nonConcurrent") {
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     sql "DROP TABLE IF EXISTS test_snii_utf8_wildcard"
     sql "DROP TABLE IF EXISTS test_v3_utf8_wildcard"
 
diff --git 
a/regression-test/suites/variant_p0/test_variant_search_subcolumn_snii.groovy 
b/regression-test/suites/variant_p0/test_variant_search_subcolumn_snii.groovy
index b69ea4f89cf..5d64074e141 100644
--- 
a/regression-test/suites/variant_p0/test_variant_search_subcolumn_snii.groovy
+++ 
b/regression-test/suites/variant_p0/test_variant_search_subcolumn_snii.groovy
@@ -17,6 +17,8 @@
 
 // Verify SNII SEARCH against direct, nested, and special-character VARIANT 
paths.
 suite("test_variant_search_subcolumn_snii") {
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     def table_name = "test_variant_search_subcolumn_snii"
     sql "set default_variant_doc_materialization_min_rows = 0"
 
diff --git 
a/regression-test/suites/variant_p0/v2/with_index/test_variant_v2_snii_index.groovy
 
b/regression-test/suites/variant_p0/v2/with_index/test_variant_v2_snii_index.groovy
index 9fabd769a92..0e8f7a2511f 100644
--- 
a/regression-test/suites/variant_p0/v2/with_index/test_variant_v2_snii_index.groovy
+++ 
b/regression-test/suites/variant_p0/v2/with_index/test_variant_v2_snii_index.groovy
@@ -17,6 +17,8 @@
 
 // Verify SNII indexes written through the VARIANT V2 writer.
 suite("test_variant_v2_snii_index", "p0,nonConcurrent") {
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     setFeConfigTemporary([enable_variant_v2: true]) {
         def tblName = "variant_v2_snii_index"
         def typedInventors = "cast(inventors['inventors'] as array<text>)"
diff --git 
a/regression-test/suites/variant_p0/with_index/test_variant_snii_compaction.groovy
 
b/regression-test/suites/variant_p0/with_index/test_variant_snii_compaction.groovy
index 150df9ef69d..0058fbd0b02 100644
--- 
a/regression-test/suites/variant_p0/with_index/test_variant_snii_compaction.groovy
+++ 
b/regression-test/suites/variant_p0/with_index/test_variant_snii_compaction.groovy
@@ -16,6 +16,8 @@
 // under the License.
 
 suite("regression_test_variant_snii_compaction", "p0, nonConcurrent"){
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     def table_name = "var_snii_compaction"
     sql """ set default_variant_enable_typed_paths_to_sparse = false """
     sql """ set default_variant_enable_doc_mode = false """
diff --git a/regression-test/suites/variant_p0/with_index/var_index_snii.groovy 
b/regression-test/suites/variant_p0/with_index/var_index_snii.groovy
index cef9d621d2c..4c2e79bd8f8 100644
--- a/regression-test/suites/variant_p0/with_index/var_index_snii.groovy
+++ b/regression-test/suites/variant_p0/with_index/var_index_snii.groovy
@@ -16,6 +16,8 @@
 // under the License.
 
 suite("regression_test_variant_var_index_snii", "p0, nonConcurrent"){
+    sql "SET enable_common_expr_pushdown=true"
+    sql "SET enable_common_expr_pushdown_for_inverted_index=true"
     sql """ set default_variant_enable_typed_paths_to_sparse = false """
     sql """ set default_variant_enable_doc_mode = false """
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to