You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2026/10/14 01:29:03 UTC
(doris) branch branch-4.2 updated: branch-4.2: [Improvement](scan) Push down LIMIT to segment iterator (#61713 #62222 #64285 #64479 #68804) (#68788)
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 ccb49f1f53d branch-4.2: [Improvement](scan) Push down LIMIT to segment iterator (#61713 #62222 #64285 #64479 #68804) (#68788)
ccb49f1f53d is described below
commit ccb49f1f53df35be84214ecbb4c4618fbb5ca098
Author: Chenyang Sun <su...@selectdb.com>
AuthorDate: Wed Oct 14 09:28:55 2026 +0800
branch-4.2: [Improvement](scan) Push down LIMIT to segment iterator (#61713 #62222 #64285 #64479 #68804) (#68788)
pick #61713 and #62222 (partial: no shared scan LIMIT counter, no
key-expression pushdown for tables merged on read), remove
enable_common_expr_pushdown as #64285 and #64479 do on master, and pick
#68804
---------
Co-authored-by: Pxl <xl...@selectdb.com>
Co-authored-by: Claude Fable 5.1 <no...@anthropic.com>
---
be/src/exec/operator/mock_scan_operator.h | 2 +-
be/src/exec/operator/olap_scan_operator.cpp | 62 ++++-
be/src/exec/operator/olap_scan_operator.h | 2 +-
be/src/exec/operator/scan_operator.cpp | 3 +-
be/src/exec/operator/scan_operator.h | 2 +-
be/src/exec/scan/olap_scanner.cpp | 59 ++++-
be/src/runtime/runtime_state.h | 12 +-
be/src/storage/iterator/vcollect_iterator.cpp | 61 ++---
be/src/storage/iterator/vcollect_iterator.h | 8 +-
be/src/storage/iterators.h | 7 +-
be/src/storage/rowset/beta_rowset_reader.cpp | 2 +-
be/src/storage/rowset/rowset_reader_context.h | 5 +-
be/src/storage/segment/segment_iterator.cpp | 89 ++++++-
be/src/storage/segment/segment_iterator.h | 7 +-
be/src/storage/tablet/tablet_reader.cpp | 13 +-
be/src/storage/tablet/tablet_reader.h | 6 +-
.../segment/segment_iterator_limit_opt_test.cpp | 208 +++++++++++++++
be/test/storage/tablet_reader_test.cpp | 116 +++++++++
.../java/org/apache/doris/qe/SessionVariable.java | 31 +--
.../main/java/org/apache/doris/qe/VariableMgr.java | 41 +++
gensrc/thrift/PaloInternalService.thrift | 5 +-
.../query_p0/limit/test_general_limit_pushdown.out | 131 ++++++++++
.../query_p0/limit/test_unified_limit_pushdown.out | 43 +++
.../data/search/test_search_slash_in_term.out | 5 +
.../test_read_mor_as_dup_key_topn.out | 35 +++
.../predefine/test_predefine_type_index.out | 8 +
.../ann_index_p0/ann_const_expr_vector.groovy | 2 +-
.../suites/ann_index_p0/ann_index_basic.groovy | 2 +-
.../ann_index_build_min_segment_rows.groovy | 2 +-
...ann_index_only_scan_compound_debug_point.groovy | 2 +-
.../ann_index_only_scan_debug_point.groovy | 2 +-
.../ann_index_only_scan_expr_debug_point.groovy | 2 +-
.../ann_range_search_pushdown_regression.groovy | 2 +-
...ge_search_source_index_status_regression.groovy | 2 +-
.../suites/ann_index_p0/ann_with_fulltext.groovy | 2 +-
.../ann_index_p0/build_ann_index_test.groovy | 2 +-
.../ann_index_p0/cast_string_as_array.groovy | 2 +-
.../ann_index_p0/create_ann_index_test.groovy | 2 +-
.../create_tbl_with_ann_index_test.groovy | 2 +-
.../suites/ann_index_p0/delete_where.groovy | 2 +-
.../ann_index_p0/insert_with_invalid_array.groovy | 2 +-
.../suites/ann_index_p0/ivf_index_test.groovy | 2 +-
.../ann_index_p0/ivf_on_disk_index_test.groovy | 2 +-
.../ivf_pq_full_buffer_train_recall.groovy | 2 +-
.../suites/ann_index_p0/ivf_pq_recall.groovy | 2 +-
.../suites/ann_index_p0/memtbl_on_sink.groovy | 2 +-
.../ann_index_p0/quantizer_min_train_rows.groovy | 2 +-
.../suites/ann_index_p0/small_segment.groovy | 2 +-
.../test_backup_restore_inverted_idx.groovy | 6 +-
.../cloud_p0/cache/test_topn_broadcast.groovy | 2 +-
.../correctness/test_pushdown_common_expr.groovy | 6 +-
.../query/test_nested_type_with_resize.groovy | 8 +-
.../basic-elements/data-types/array-md.groovy | 4 +-
.../test_all_index_hit_fault_injection.groovy | 2 +-
...dex_compaction_exception_fault_injection.groovy | 12 +-
...test_index_compound_file_fault_injection.groovy | 2 +-
...test_index_empty_segment_fault_injection.groovy | 2 +-
.../test_index_file_cache_fault_injection.groovy | 2 +-
.../test_index_inlist_fault_injection.groovy | 8 +-
.../test_index_mow_fault_injection.groovy | 2 +-
...test_match_without_index_fault_injection.groovy | 2 +-
.../test_need_read_data_fault_injection.groovy | 2 +-
...t_variant_count_on_index_fault_injection.groovy | 2 +-
...inverted_index_exception_fault_injection.groovy | 14 +-
.../analyzer/test_basic_analyzer.groovy | 2 +-
...test_builtin_analyzer_in_custom_analyzer.groovy | 4 +-
.../analyzer/test_char_group_tokenizer.groovy | 2 +-
.../analyzer/test_custom_analyzer.groovy | 12 +-
.../analyzer/test_custom_analyzer1.groovy | 2 +-
.../analyzer/test_custom_analyzer2.groovy | 2 +-
.../analyzer/test_custom_normalizer.groovy | 2 +-
.../analyzer/test_icu_analyzer.groovy | 2 +-
.../analyzer/test_ik_analyzer.groovy | 2 +-
.../test_add_drop_index_with_data_arr.groovy | 3 +-
...test_add_drop_index_with_delete_data_arr.groovy | 3 +-
.../array_contains/test_add_index_for_arr.groovy | 2 +-
.../test_array_contains_estimate.groovy | 2 +-
.../array_contains/test_char_replace_arr.groovy | 3 +-
.../array_contains/test_compound_arr.groovy | 3 +-
.../test_count_on_index_httplogs_arr.groovy | 3 +-
.../test_equal_on_fulltext_arr.groovy | 3 +-
.../array_contains/test_index_bkd_null_arr.groovy | 3 +-
.../array_contains/test_index_change_2_arr.groovy | 3 +-
.../array_contains/test_index_change_4_arr.groovy | 3 +-
.../array_contains/test_index_change_6_arr.groovy | 3 +-
.../test_index_compaction_dup_keys_arr.groovy | 3 +-
.../test_index_compaction_null_arr.groovy | 3 +-
.../test_index_compaction_unique_keys_arr.groovy | 3 +-
...compaction_with_multi_index_segments_arr.groovy | 3 +-
.../array_contains/test_index_delete_arr.groovy | 3 +-
.../test_index_empty_string_arr.groovy | 3 +-
.../test_index_equal_select_arr.groovy | 3 +-
.../test_index_match_phrase_edge_arr.groovy | 3 +-
.../test_index_match_regexp_arr.groovy | 3 +-
.../array_contains/test_index_null_arr.groovy | 3 +-
.../array_contains/test_invalid_param.groovy | 3 +-
.../test_inverted_index_null_arr.groovy | 3 +-
.../array_contains/test_lowercase_arr.groovy | 3 +-
.../test_parser_with_none_stopwords.groovy | 3 +-
.../char_filter/test_char_replace.groovy | 2 +-
.../gram/test_gram_compaction.groovy | 3 +-
.../gram/test_gram_index_order.groovy | 3 +-
.../gram/test_gram_metadata_inherit.groovy | 3 +-
.../gram/test_gram_pattern_recall.groovy | 3 +-
.../gram/test_gram_policy_recovery.groovy | 3 +-
.../gram/test_gram_regexp_like.groovy | 3 +-
.../gram/test_gram_schema_change.groovy | 3 +-
.../gram/test_gram_stop_gram.groovy | 3 +-
.../test_build_index_multi_analyzer_order.groovy | 2 +-
.../test_index_compaction_dup_keys.groovy | 2 +-
.../test_index_compaction_null.groovy | 4 +-
.../test_index_compaction_unique_keys.groovy | 2 +-
...dex_compaction_with_multi_index_segments.groovy | 2 +-
...est_cumulative_compaction_with_format_v2.groovy | 2 +-
.../test_drop_column_with_format_v2.groovy | 2 +-
.../test_drop_index_with_format_v2.groovy | 2 +-
.../test_mor_table_with_format_v2.groovy | 2 +-
.../test_mow_table_with_format_v2.groovy | 2 +-
.../test_rename_column_with_format_v2.groovy | 2 +-
.../storage_format/test_storage_format_snii.groovy | 3 +-
...test_storage_format_snii_custom_analyzer.groovy | 3 +-
.../test_storage_format_snii_norms.groovy | 3 +-
.../test_storage_format_snii_utf8_wildcard.groovy | 3 +-
.../storage_format/test_storage_format_v1.groovy | 2 +-
.../storage_format/test_storage_format_v2.groovy | 2 +-
.../test_arrayInvertedIdx_profile.groovy | 5 +-
.../test_array_contains_with_inverted_index.groovy | 43 ++-
.../inverted_index_p0/test_array_index.groovy | 2 +-
.../sql/insert_with_query.sql | 2 +-
.../test_array_with_inverted_index_all_type.groovy | 7 +-
.../inverted_index_p0/test_bm25_score.groovy | 8 +-
.../test_bm25_score_range_filter.groovy | 2 +-
.../test_bm25_score_variant.groovy | 2 +-
.../inverted_index_p0/test_chinese_analyzer.groovy | 2 +-
.../test_complex_or_null_semantics.groovy | 2 +-
.../suites/inverted_index_p0/test_compound.groovy | 2 +-
.../inverted_index_p0/test_compound_1.groovy | 8 +-
.../inverted_index_p0/test_compound_inlist.groovy | 6 +-
.../inverted_index_p0/test_count_on_index.groovy | 2 +-
.../inverted_index_p0/test_count_on_index_2.groovy | 2 +-
.../test_cross_field_or_with_null.groovy | 6 +-
.../suites/inverted_index_p0/test_delete.groovy | 2 +-
.../test_empty_string_match.groovy | 2 +-
.../test_equal_on_fulltext.groovy | 2 +-
.../inverted_index_p0/test_expr_in_null.groovy | 2 +-
.../inverted_index_p0/test_float_double.groovy | 2 +-
.../test_ignore_above_in_index.groovy | 2 +-
.../test_index_chinese_column.groovy | 2 +-
.../test_index_complex_match.groovy | 2 +-
.../inverted_index_p0/test_index_delete.groovy | 2 +-
.../test_index_empty_string.groovy | 2 +-
.../test_index_equal_select.groovy | 2 +-
.../test_index_key_match_select.groovy | 2 +-
.../test_index_lowercase_fault_injection.groovy | 2 +-
.../test_index_match_phrase.groovy | 2 +-
.../test_index_match_phrase_edge.groovy | 4 +-
.../test_index_match_phrase_ordered.groovy | 2 +-
.../test_index_match_phrase_prefix.groovy | 2 +-
.../test_index_match_phrase_prefix_1.groovy | 2 +-
.../test_index_match_phrase_slop.groovy | 2 +-
.../test_index_match_regexp.groovy | 2 +-
.../test_index_match_select.groovy | 2 +-
.../test_index_multi_match.groovy | 2 +-
.../test_index_no_need_read_data.groovy | 2 +-
.../inverted_index_p0/test_index_null.groovy | 2 +-
.../test_index_range_between_select.groovy | 2 +-
...test_index_range_bigger_and_equal_select.groovy | 2 +-
.../test_index_range_bigger_select.groovy | 2 +-
.../test_index_range_in_select.groovy | 2 +-
.../test_index_range_not_in_select.groovy | 2 +-
...est_index_range_smaller_and_equal_select.groovy | 2 +-
.../test_index_range_smaller_select.groovy | 2 +-
.../inverted_index_p0/test_index_rqg_bug.groovy | 2 +-
.../inverted_index_p0/test_index_rqg_bug2.groovy | 2 +-
.../inverted_index_p0/test_index_rqg_bug3.groovy | 2 +-
.../inverted_index_p0/test_index_rqg_bug4.groovy | 2 +-
.../test_index_skip_read_data.groovy | 2 +-
.../inverted_index_p0/test_inverted_index.groovy | 2 +-
.../test_inverted_index_collection_stats.groovy | 3 +-
.../test_inverted_index_io_timer.groovy | 3 +-
.../test_inverted_index_keyword.groovy | 2 +-
.../test_inverted_index_mor.groovy | 2 +-
.../test_inverted_index_null.groovy | 2 +-
.../test_inverted_index_null_ram_dir.groovy | 2 +-
.../test_inverted_index_v2_file_size.groovy | 2 +-
.../inverted_index_p0/test_inverted_is_null.groovy | 2 +-
.../test_ip_cidr_search_with_inverted_index.groovy | 6 +-
.../inverted_index_p0/test_is_null_expr.groovy | 4 +-
.../suites/inverted_index_p0/test_lowercase.groovy | 2 +-
.../test_match_or_null_semantics.groovy | 6 +-
.../test_match_query_without_index.groovy | 2 +-
.../inverted_index_p0/test_need_read_data.groovy | 6 +-
.../inverted_index_p0/test_no_index_match.groovy | 2 +-
.../inverted_index_p0/test_null_index.groovy | 4 +-
.../inverted_index_p0/test_or_not_match.groovy | 2 +-
.../inverted_index_p0/test_pinyin_phrase.groovy | 2 +-
.../test_pk_no_need_read_data.groovy | 2 +-
.../test_search_or_null_semantics.groovy | 26 +-
.../test_single_column_multi_index.groovy | 3 +-
.../test_single_column_multi_index1.groovy | 3 +-
.../suites/inverted_index_p0/test_stopwords.groovy | 2 +-
.../test_variant_subcolumn_index_norms.groovy | 2 +-
.../inverted_index_p0/topn_clear_block.groovy | 2 +-
.../test_mow_with_null_sequence.groovy | 2 +-
.../unique_with_mow/test_pk_uk_case.groovy | 2 +-
.../test_primary_key_simple_case.groovy | 2 +-
.../test_unique_mow_sequence.groovy | 2 +-
.../test_dup_table_inverted_index.groovy | 6 +-
.../sql/basic_q01.sql | 24 +-
.../sql/basic_q02.sql | 24 +-
.../sql/fulltext_q01.sql | 38 +--
.../sql/fulltext_q02.sql | 38 +--
.../sql/large_records_q01.sql | 20 +-
.../sql/large_records_q02.sql | 20 +-
.../sql/large_records_q03.sql | 18 +-
.../sql/large_records_q04.sql | 18 +-
.../sql/large_records_q05.sql | 12 +-
.../sql/large_records_q06.sql | 12 +-
.../sql/large_records_q07.sql | 12 +-
.../sql/large_records_q08.sql | 12 +-
.../nereids_rules_p0/mv/variant/variant_mv.groovy | 2 +-
.../expr_zonemap/test_expr_zonemap_pruning.groovy | 2 +-
...gg_after_nested_loop_join_local_exchange.groovy | 3 +-
.../limit/test_general_limit_pushdown.groovy | 287 +++++++++++++++++++++
.../limit/test_unified_limit_pushdown.groovy | 233 +++++++++++++++++
.../test_validate_restore_inverted_idx.groovy | 6 +-
..._materialized_view_common_expr_push_down.groovy | 2 +-
.../search/test_disable_root_variant_match.groovy | 8 +-
.../search/test_search_boundary_cases.groovy | 40 +--
.../suites/search/test_search_cache.groovy | 20 +-
.../test_search_default_field_operator.groovy | 40 +--
.../suites/search/test_search_dsl_operators.groovy | 30 +--
.../suites/search/test_search_dsl_syntax.groovy | 104 ++++----
.../suites/search/test_search_escape.groovy | 30 +--
.../suites/search/test_search_exact_basic.groovy | 10 +-
.../search/test_search_exact_lowercase.groovy | 22 +-
.../suites/search/test_search_exact_match.groovy | 46 ++--
.../search/test_search_exact_multi_index.groovy | 18 +-
.../search/test_search_field_group_query.groovy | 4 +-
.../suites/search/test_search_function.groovy | 44 ++--
.../search/test_search_inverted_index.groovy | 46 ++--
.../test_search_inverted_index_profile.groovy | 17 +-
.../test_search_inverted_is_null_pushdown.groovy | 2 +-
.../suites/search/test_search_lucene_mode.groovy | 38 +--
.../suites/search/test_search_mow_support.groovy | 4 +-
.../test_search_multi_analyzer_lucene.groovy | 34 +--
.../suites/search/test_search_multi_field.groovy | 62 ++---
.../search/test_search_not_null_bitmap.groovy | 30 +--
.../search/test_search_null_regression.groovy | 44 ++--
.../search/test_search_null_semantics.groovy | 86 +++---
.../search/test_search_regexp_lowercase.groovy | 28 +-
.../suites/search/test_search_slash_in_term.groovy | 23 +-
.../search/test_search_usage_restrictions.groovy | 36 +--
.../test_search_variant_dual_index_reader.groovy | 14 +-
.../test_search_variant_subcolumn_analyzer.groovy | 18 +-
.../search/test_search_variant_wildcard.groovy | 26 +-
..._search_variant_wildcard_custom_analyzer.groovy | 28 +-
.../search/test_search_vs_match_consistency.groovy | 100 +++----
.../test_read_mor_as_dup_key_topn.groovy | 54 ++++
.../suites/variant_doc_mode_p2/load.groovy | 2 +-
.../variant_github_events_new_p2/load.groovy | 12 +-
.../load.groovy | 2 +-
.../suites/variant_p0/doc_mode/load.groovy | 2 +-
.../test_prdefine_insert_into_select.groovy | 2 +-
.../predefine/test_predefine_pattern.groovy | 2 +-
.../predefine/test_predefine_schema_change.groovy | 2 +-
.../predefine/test_predefine_type_index.groovy | 4 +-
.../test_array_contains_with_inverted_index.groovy | 43 ++-
.../test_variant_external_meta_integration.groovy | 3 +-
regression-test/suites/variant_p0/load.groovy | 2 +-
.../predefine/predefined_typed_to_sparse.groovy | 2 +-
.../predefined_typed_to_sparse_1shard.groovy | 2 +-
.../predefine/test_custom_analyzer.groovy | 6 +-
.../predefine/test_multi_index_file.groovy | 2 +-
.../predefine/test_multi_index_nonCurrent.groovy | 6 +-
.../test_prdefine_insert_into_select.groovy | 2 +-
.../predefine/test_predefine_pattern.groovy | 2 +-
.../predefine/test_predefine_schema_change.groovy | 2 +-
.../predefine/test_predefine_type_index.groovy | 18 +-
.../test_predefine_type_multi_index.groovy | 4 +-
.../test_types_with_indexes_profile.groovy | 2 +-
.../predefine/test_variant_is_null_expr.groovy | 4 +-
.../suites/variant_p0/query_subcolumns.groovy | 2 +-
.../test_add_multi_var_mulit_indexes.groovy | 3 +-
.../suites/variant_p0/test_sub_path_pruning.groovy | 2 +-
.../variant_p0/test_variant_is_null_expr.groovy | 6 +-
.../test_variant_search_subcolumn.groovy | 20 +-
.../test_variant_search_subcolumn_snii.groovy | 3 +-
.../v2/predefine/predefined_typed_to_sparse.groovy | 2 +-
.../predefined_typed_to_sparse_1shard.groovy | 2 +-
.../test_array_contains_with_inverted_index.groovy | 42 +--
.../with_index/test_variant_v2_snii_index.groovy | 3 +-
.../suites/variant_p0/with_index/load.groovy | 2 +-
.../test_array_contains_with_inverted_index.groovy | 43 ++-
.../with_index/test_variant_snii_compaction.groovy | 3 +-
.../suites/variant_p0/with_index/var_index.groovy | 2 +-
.../variant_p0/with_index/var_index_snii.groovy | 3 +-
.../suites/variant_p1/doc_snapshot/load.groovy | 2 +-
.../suites/variant_p1/predefine/load.groovy | 2 +-
299 files changed, 2493 insertions(+), 1206 deletions(-)
diff --git a/be/src/exec/operator/mock_scan_operator.h b/be/src/exec/operator/mock_scan_operator.h
index ad3722c1de6..3eaa78366a8 100644
--- a/be/src/exec/operator/mock_scan_operator.h
+++ b/be/src/exec/operator/mock_scan_operator.h
@@ -39,7 +39,7 @@ private:
return PushDownType::ACCEPTABLE;
}
- bool _should_push_down_common_expr() override { return true; }
+ bool _should_push_down_common_expr(const VExprSPtr&) override { return true; }
PushDownType _should_push_down_topn_filter() const override { return PushDownType::ACCEPTABLE; }
PushDownType _should_push_down_is_null_predicate(VectorizedFnCall* fn_call) const override {
diff --git a/be/src/exec/operator/olap_scan_operator.cpp b/be/src/exec/operator/olap_scan_operator.cpp
index 53a47658c6a..61539052298 100644
--- a/be/src/exec/operator/olap_scan_operator.cpp
+++ b/be/src/exec/operator/olap_scan_operator.cpp
@@ -436,12 +436,66 @@ Status OlapScanLocalState::_init_profile() {
return Status::OK();
}
+static bool contains_expr_node_type(const VExprSPtr& expr, TExprNodeType::type node_type) {
+ DORIS_CHECK(expr != nullptr);
+ if (expr->node_type() == node_type) {
+ return true;
+ }
+ if (expr->is_rf_wrapper() && contains_expr_node_type(expr->get_impl(), node_type)) {
+ return true;
+ }
+ return std::ranges::any_of(expr->children(), [node_type](const auto& child) {
+ return contains_expr_node_type(child, node_type);
+ });
+}
+
+static Status validate_residual_scan_conjuncts(RuntimeState* state,
+ TPushAggOp::type push_down_agg_type,
+ const VExprContextSPtrs& conjuncts) {
+ for (const auto& conjunct : conjuncts) {
+ const auto& root = conjunct->root();
+ if (contains_expr_node_type(root, TExprNodeType::SEARCH_EXPR)) {
+ return Status::InvalidArgument(
+ "SEARCH expression remains as a residual scan predicate. A valid search() "
+ "must bind at least one indexed field and be evaluated in SegmentIterator, "
+ "which takes such expressions only when the table is not merged on read "
+ "(DUPLICATE, or UNIQUE with merge-on-write). enable_segment_limit_pushdown "
+ "only controls SegmentIterator LIMIT pushdown and cannot make residual "
+ "SEARCH executable.");
+ }
+ if (!state->query_options().enable_match_without_inverted_index &&
+ contains_expr_node_type(root, TExprNodeType::MATCH_PRED)) {
+ return Status::InvalidArgument(
+ "MATCH expression remains as a residual scan predicate and would fall back to "
+ "a disabled slow path because enable_match_without_inverted_index is false. "
+ "SegmentIterator evaluates MATCH only when the table is not merged on read "
+ "(DUPLICATE, or UNIQUE with merge-on-write). enable_segment_limit_pushdown "
+ "only controls SegmentIterator LIMIT pushdown and cannot make residual MATCH "
+ "executable. Set enable_match_without_inverted_index=true to allow slow MATCH "
+ "execution.");
+ }
+ }
+
+ if (push_down_agg_type == TPushAggOp::COUNT_ON_INDEX && !conjuncts.empty()) {
+ return Status::InvalidArgument(
+ "COUNT_ON_INDEX pushdown cannot be used with residual scan predicates. "
+ "Residual predicates must be evaluated before COUNT_ON_INDEX counts rows; "
+ "otherwise the query may return incorrect results. "
+ "enable_segment_limit_pushdown only controls SegmentIterator LIMIT pushdown and "
+ "does not make COUNT_ON_INDEX safe with residual predicates. Set "
+ "enable_count_on_index_pushdown=false to disable COUNT_ON_INDEX pushdown.");
+ }
+ return Status::OK();
+}
+
Status OlapScanLocalState::_process_conjuncts(RuntimeState* state) {
SCOPED_TIMER(_process_conjunct_timer);
RETURN_IF_ERROR(ScanLocalState::_process_conjuncts(state));
if (ScanLocalState::_eos) {
return Status::OK();
}
+ auto& p = _parent->cast<OlapScanOperatorX>();
+ RETURN_IF_ERROR(validate_residual_scan_conjuncts(state, p._push_down_agg_type, _conjuncts));
RETURN_IF_ERROR(_build_key_ranges_and_filters());
return Status::OK();
}
@@ -500,8 +554,10 @@ Status OlapScanLocalState::_should_push_down_function_filter(VectorizedFnCall* f
return Status::OK();
}
-bool OlapScanLocalState::_should_push_down_common_expr() {
- return state()->enable_common_expr_pushdown() && _storage_no_merge();
+bool OlapScanLocalState::_should_push_down_common_expr(const VExprSPtr& expr) {
+ // Tables merged on read (AGG, UNIQUE without merge-on-write) keep their conjuncts in the
+ // scanner, as before: SegmentIterator would filter rows before the merge.
+ return _storage_no_merge() && VExpr::is_acting_on_a_slot(*expr);
}
bool OlapScanLocalState::_storage_no_merge() {
@@ -1111,6 +1167,8 @@ OlapScanOperatorX::OlapScanOperatorX(ObjectPool* pool, const TPlanNode& tnode, i
_cache_param(param) {
_output_tuple_id = tnode.olap_scan_node.tuple_id;
if (_olap_scan_node.__isset.sort_info && _olap_scan_node.__isset.sort_limit) {
+ DORIS_CHECK(_limit < 0);
+ DORIS_CHECK(_olap_scan_node.sort_limit > 0);
_limit_per_scanner = _olap_scan_node.sort_limit;
}
DBUG_EXECUTE_IF("segment_iterator.topn_opt_1", {
diff --git a/be/src/exec/operator/olap_scan_operator.h b/be/src/exec/operator/olap_scan_operator.h
index 660388a5017..59627b77342 100644
--- a/be/src/exec/operator/olap_scan_operator.h
+++ b/be/src/exec/operator/olap_scan_operator.h
@@ -97,7 +97,7 @@ private:
VectorizedFnCall* fn_call, VExprContext* expr_ctx, Field& constant_val,
const std::set<std::string> fn_name) const override;
- bool _should_push_down_common_expr() override;
+ bool _should_push_down_common_expr(const VExprSPtr& expr) override;
bool _storage_no_merge() override;
diff --git a/be/src/exec/operator/scan_operator.cpp b/be/src/exec/operator/scan_operator.cpp
index 7eb6c8c2489..5850233df4b 100644
--- a/be/src/exec/operator/scan_operator.cpp
+++ b/be/src/exec/operator/scan_operator.cpp
@@ -321,8 +321,7 @@ Status ScanLocalState<Derived>::_normalize_conjuncts(RuntimeState* state) {
RETURN_IF_ERROR(_normalize_predicate(conjunct.get(), conjunct->root(), new_root));
if (new_root) {
conjunct->set_root(new_root);
- if (_should_push_down_common_expr() &&
- VExpr::is_acting_on_a_slot(*(conjunct->root()))) {
+ if (_should_push_down_common_expr(conjunct->root())) {
_common_expr_ctxs_push_down.emplace_back(conjunct);
it = _conjuncts.erase(it);
continue;
diff --git a/be/src/exec/operator/scan_operator.h b/be/src/exec/operator/scan_operator.h
index 929a67d0755..629bf18ad20 100644
--- a/be/src/exec/operator/scan_operator.h
+++ b/be/src/exec/operator/scan_operator.h
@@ -281,7 +281,7 @@ protected:
Status _init_profile() override;
virtual Status _process_conjuncts(RuntimeState* state) { return _normalize_conjuncts(state); }
- virtual bool _should_push_down_common_expr() { return false; }
+ virtual bool _should_push_down_common_expr(const VExprSPtr&) { return false; }
virtual bool _storage_no_merge() { return false; }
virtual bool _is_key_column(const std::string& col_name) { return false; }
diff --git a/be/src/exec/scan/olap_scanner.cpp b/be/src/exec/scan/olap_scanner.cpp
index 87859632894..dd9ba15d98a 100644
--- a/be/src/exec/scan/olap_scanner.cpp
+++ b/be/src/exec/scan/olap_scanner.cpp
@@ -90,7 +90,6 @@ OlapScanner::OlapScanner(ScanLocalStateBase* parent, OlapScanner::Params&& param
.output_columns {},
.common_expr_ctxs_push_down {},
.topn_filter_source_node_ids {},
- .filter_block_conjuncts {},
.key_group_cluster_key_idxes {},
.virtual_column_exprs {},
.vir_cid_to_idx_in_block {},
@@ -459,23 +458,63 @@ Status OlapScanner::_init_tablet_reader_params(
_tablet_reader_params.enable_mor_value_predicate_pushdown = true;
}
- // order by table keys optimization for topn
- // will only read head/tail of data file since it's already sorted by keys
- if (olap_scan_node.__isset.sort_info && !olap_scan_node.sort_info.is_asc_order.empty()) {
+ const bool has_key_topn =
+ olap_scan_node.__isset.sort_info && !olap_scan_node.sort_info.is_asc_order.empty();
+ if (has_key_topn) {
_limit = _local_state->limit_per_scanner();
+ }
+
+ const bool no_runtime_filters = _total_rf_num == 0;
+ const bool segment_limit_enabled = _state->enable_segment_limit_pushdown();
+ const bool storage_no_merge = olap_scan_local_state->_storage_no_merge();
+ // Storage TopN compares key columns that TabletReader prepares only for DUP and
+ // merge-on-write tablets, so a MOR table read as DUP cannot use it.
+ const bool storage_topn_supported = storage_no_merge && !read_mor_as_dup;
+
+ if (_limit > 0 && no_runtime_filters && segment_limit_enabled && storage_no_merge) {
+ for (const auto& conjunct : _conjuncts) {
+ DORIS_CHECK(!VExpr::is_acting_on_a_slot(*conjunct->root()));
+ }
+ }
+
+ // Segment LIMIT has only two legal states: completely disabled, or enabled after every
+ // row-filtering conjunct has become a storage predicate or SegmentIterator common expr.
+ // A key TopN also needs storage TopN support, otherwise nothing is pushed.
+ const bool can_push_down_segment_limit =
+ _limit > 0 && no_runtime_filters && _conjuncts.empty() && segment_limit_enabled &&
+ storage_no_merge && (!has_key_topn || storage_topn_supported);
+ if (can_push_down_segment_limit) {
+ if (has_key_topn) {
+ _tablet_reader_params.read_orderby_key = true;
+ if (!olap_scan_node.sort_info.is_asc_order[0]) {
+ _tablet_reader_params.read_orderby_key_reverse = true;
+ }
+ _tablet_reader_params.read_orderby_key_num_prefix_columns =
+ olap_scan_node.sort_info.is_asc_order.size();
+ _tablet_reader_params.read_orderby_key_limit = _limit;
+ } else {
+ _tablet_reader_params.general_read_limit = _limit;
+ }
+ } else if (has_key_topn && !storage_no_merge && no_runtime_filters) {
+ // Tables merged on read return rows in key order (rowsets are merged by key,
+ // reversed for DESC), so each scanner can stop after its own N rows and keeps
+ // _limit. Storage TopN stays off. A late runtime filter would break the count.
_tablet_reader_params.read_orderby_key = true;
if (!olap_scan_node.sort_info.is_asc_order[0]) {
_tablet_reader_params.read_orderby_key_reverse = true;
}
_tablet_reader_params.read_orderby_key_num_prefix_columns =
olap_scan_node.sort_info.is_asc_order.size();
- _tablet_reader_params.read_orderby_key_limit = _limit;
+ } else if (has_key_topn) {
+ // Without storage TopN the rows are not in key order, so the upper TopN needs
+ // every row from this scanner.
+ _limit = -1;
+ }
- if (_tablet_reader_params.read_orderby_key_limit > 0 &&
- olap_scan_local_state->_storage_no_merge()) {
- _tablet_reader_params.filter_block_conjuncts = _conjuncts;
- _conjuncts.clear();
- }
+ if (_tablet_reader_params.read_orderby_key_limit > 0 ||
+ _tablet_reader_params.general_read_limit > 0) {
+ DORIS_CHECK(can_push_down_segment_limit);
+ DORIS_CHECK(_conjuncts.empty());
}
// set push down topn filter
diff --git a/be/src/runtime/runtime_state.h b/be/src/runtime/runtime_state.h
index f264851b377..190b25137e0 100644
--- a/be/src/runtime/runtime_state.h
+++ b/be/src/runtime/runtime_state.h
@@ -248,17 +248,11 @@ public:
return _query_options.__isset.enable_insert_strict && _query_options.enable_insert_strict;
}
- bool enable_common_expr_pushdown() const {
- return _query_options.__isset.enable_common_expr_pushdown &&
- _query_options.enable_common_expr_pushdown;
+ bool enable_segment_limit_pushdown() const {
+ return !_query_options.__isset.enable_segment_limit_pushdown ||
+ _query_options.enable_segment_limit_pushdown;
}
- bool enable_common_expr_pushdown_for_inverted_index() const {
- return enable_common_expr_pushdown() &&
- _query_options.__isset.enable_common_expr_pushdown_for_inverted_index &&
- _query_options.enable_common_expr_pushdown_for_inverted_index;
- };
-
bool mysql_row_binary_format() const {
return _query_options.__isset.mysql_row_binary_format &&
_query_options.mysql_row_binary_format;
diff --git a/be/src/storage/iterator/vcollect_iterator.cpp b/be/src/storage/iterator/vcollect_iterator.cpp
index 843623c8021..fc00060f1d0 100644
--- a/be/src/storage/iterator/vcollect_iterator.cpp
+++ b/be/src/storage/iterator/vcollect_iterator.cpp
@@ -37,7 +37,6 @@
#include "core/data_type/data_type.h"
#include "core/data_type/data_type_number.h" // IWYU pragma: keep
#include "core/field.h"
-#include "exprs/vexpr_context.h"
#include "io/io_common.h"
#include "runtime/query_context.h"
#include "runtime/runtime_predicate.h"
@@ -86,24 +85,31 @@ void VCollectIterator::init(TabletReader* reader, bool ori_data_overlapping, boo
}
_is_reverse = is_reverse;
- // use topn_next opt only for DUP_KEYS and UNIQUE_KEYS with MOW
- if (_reader->_reader_context.read_orderby_key_limit > 0 &&
- (_reader->_tablet->keys_type() == KeysType::DUP_KEYS ||
- (_reader->_tablet->keys_type() == KeysType::UNIQUE_KEYS &&
- _reader->_tablet->enable_unique_key_merge_on_write()))) {
+ // TopN limit. Whether we reach here is decided by the scanner;
+ // it only sets read_orderby_key_limit on the no-merge tablet types.
+ if (_reader->_reader_context.read_orderby_key_limit > 0) {
_topn_limit = _reader->_reader_context.read_orderby_key_limit;
- } else {
- _topn_limit = 0;
- DCHECK_EQ(_reader->_reader_context.filter_block_conjuncts.size(), 0);
+ DORIS_CHECK(_reader->_reader_context.general_read_limit <= 0);
+ }
+ // General limit is forwarded to SegmentIterator, which applies it after
+ // predicate/common-expr filtering and before lazy-reading non-predicate columns.
+ if (_reader->_reader_context.general_read_limit > 0) {
+ _general_read_limit = static_cast<size_t>(_reader->_reader_context.general_read_limit);
}
}
Status VCollectIterator::add_child(const RowSetSplits& rs_splits) {
+ // Forward the local row budget to SegmentIterator. SegmentIterator applies
+ // it after its own predicate/common-expr filtering, so LIMIT and pushed
+ // conjuncts stay in the same layer.
if (use_topn_next()) {
rs_splits.rs_reader->set_topn_limit(_topn_limit);
_rs_splits.push_back(rs_splits);
return Status::OK();
}
+ if (_general_read_limit > 0) {
+ rs_splits.rs_reader->set_topn_limit(_general_read_limit);
+ }
_children.push_back(std::make_unique<Level0Iterator>(rs_splits.rs_reader, _reader));
return Status::OK();
@@ -114,6 +120,7 @@ Status VCollectIterator::add_child(const RowSetSplits& rs_splits) {
// then merged with the base rowset.
Status VCollectIterator::build_heap(std::vector<RowsetReaderSharedPtr>& rs_readers) {
if (use_topn_next()) {
+ DORIS_CHECK(_children.empty());
return Status::OK();
}
@@ -250,27 +257,27 @@ Status VCollectIterator::next(Block* block) {
}
if (LIKELY(_inner_iter)) {
- return _inner_iter->next(block);
+ auto st = _inner_iter->next(block);
+ if (UNLIKELY(!st.ok())) {
+ return st;
+ }
+ return Status::OK();
} else {
return Status::Error<END_OF_FILE>("");
}
}
Status VCollectIterator::_topn_next(Block* block) {
+ DORIS_CHECK(block != nullptr);
+ DORIS_CHECK(use_topn_next());
+ DORIS_CHECK(_reader->_reader_context.read_orderby_key_columns != nullptr);
+ DORIS_CHECK(!_reader->_reader_context.read_orderby_key_columns->empty());
+
if (_topn_eof) {
return Status::Error<END_OF_FILE>("");
}
auto clone_block = block->clone_empty();
- /*
- select id, "${tR2}",
- l2_distance_approximate
- from ann_index_only_scan
- where l2_distance_approximate < 10
- order by id
- limit 20;
- where id is the orderby key column.
- */
// Initialize virtual slot columns by schema (avoid runtime type checks):
// use _reader_context.vir_col_idx_to_type to construct real columns for those positions.
if (!_reader->_reader_context.vir_col_idx_to_type.empty()) {
@@ -284,13 +291,11 @@ Status VCollectIterator::_topn_next(Block* block) {
}
MutableBlock mutable_block = MutableBlock::build_mutable_block(std::move(clone_block));
- if (!_reader->_reader_context.read_orderby_key_columns) {
- return Status::Error<ErrorCode::INTERNAL_ERROR>(
- "read_orderby_key_columns should not be nullptr");
- }
-
- size_t first_sort_column_idx = (*_reader->_reader_context.read_orderby_key_columns)[0];
const std::vector<uint32_t>* sort_columns = _reader->_reader_context.read_orderby_key_columns;
+ for (auto column_idx : *sort_columns) {
+ DORIS_CHECK(column_idx < clone_block.columns());
+ }
+ size_t first_sort_column_idx = (*sort_columns)[0];
BlockRowPosComparator row_pos_comparator(&mutable_block, sort_columns,
_reader->_reader_context.read_orderby_key_reverse);
@@ -323,10 +328,6 @@ Status VCollectIterator::_topn_next(Block* block) {
}
}
- // filter block
- RETURN_IF_ERROR(VExprContext::filter_block(
- _reader->_reader_context.filter_block_conjuncts, block, block->columns()));
-
// update read rows
read_rows += block->rows();
@@ -354,6 +355,8 @@ Status VCollectIterator::_topn_next(Block* block) {
int res = 0;
for (auto k : *sort_columns) {
+ DORIS_CHECK(k < block->columns());
+ DORIS_CHECK(k < mutable_block.columns());
DCHECK(block->get_by_position(k).type->equals(
*mutable_block.get_datatype_by_position(k)));
res = block->get_by_position(k).column->compare_at(
diff --git a/be/src/storage/iterator/vcollect_iterator.h b/be/src/storage/iterator/vcollect_iterator.h
index 710d6f7903e..c297f9f3750 100644
--- a/be/src/storage/iterator/vcollect_iterator.h
+++ b/be/src/storage/iterator/vcollect_iterator.h
@@ -92,7 +92,8 @@ public:
inline bool use_topn_next() const { return _topn_limit > 0; }
private:
- // next for topn query
+ // Scanner-local TopN merge. SegmentIterator has already applied all pushed filters and its
+ // per-segment row budget; this path only keeps the best local rows across rowsets.
Status _topn_next(Block* block);
class BlockRowPosComparator {
@@ -356,9 +357,8 @@ private:
// for topn next
size_t _topn_limit = 0;
bool _topn_eof = false;
- // For chunked topN output when result exceeds byte budget.
- Block _topn_result_block;
- size_t _topn_result_offset = 0;
+ // for forwarding general LIMIT to SegmentIterator
+ size_t _general_read_limit = 0;
std::vector<RowSetSplits> _rs_splits;
// Hold reader point to access read params, such as fetch conditions.
diff --git a/be/src/storage/iterators.h b/be/src/storage/iterators.h
index d0cb859627b..32f733e9b24 100644
--- a/be/src/storage/iterators.h
+++ b/be/src/storage/iterators.h
@@ -134,7 +134,12 @@ public:
// slots that cast may be eliminated in storage layer
std::map<std::string, DataTypePtr> target_cast_type_for_variants;
RowRanges row_ranges;
- size_t topn_limit = 0;
+
+ // Per-segment row budget pushed down from the scanner (topn or general
+ // limit). SegmentIterator applies it after predicate/common-expr filtering;
+ // _can_opt_limit_reads() only decides whether the pre-filter read can also
+ // be capped. 0 disables the optimization.
+ size_t read_limit = 0;
std::map<ColumnId, VExprContextSPtr> virtual_column_exprs;
std::shared_ptr<segment_v2::AnnTopNRuntime> ann_topn_runtime;
diff --git a/be/src/storage/rowset/beta_rowset_reader.cpp b/be/src/storage/rowset/beta_rowset_reader.cpp
index 61e2b9acf02..e2e3f7512c1 100644
--- a/be/src/storage/rowset/beta_rowset_reader.cpp
+++ b/be/src/storage/rowset/beta_rowset_reader.cpp
@@ -115,7 +115,7 @@ Status BetaRowsetReader::get_segment_iterators(RowsetReaderContext* read_context
_read_options.rowset_id = _rowset->rowset_id();
_read_options.version = _rowset->version();
_read_options.tablet_id = _rowset->rowset_meta()->tablet_id();
- _read_options.topn_limit = _topn_limit;
+ _read_options.read_limit = _topn_limit;
if (_read_context->lower_bound_keys != nullptr) {
for (int i = 0; i < _read_context->lower_bound_keys->size(); ++i) {
_read_options.key_ranges.emplace_back(&_read_context->lower_bound_keys->at(i),
diff --git a/be/src/storage/rowset/rowset_reader_context.h b/be/src/storage/rowset/rowset_reader_context.h
index 539a4576d65..187de048c91 100644
--- a/be/src/storage/rowset/rowset_reader_context.h
+++ b/be/src/storage/rowset/rowset_reader_context.h
@@ -51,8 +51,6 @@ struct RowsetReaderContext {
std::vector<uint32_t>* read_orderby_key_columns = nullptr;
// limit of rows for read_orderby_key
size_t read_orderby_key_limit = 0;
- // filter_block arguments
- VExprContextSPtrs filter_block_conjuncts;
// projection columns: the set of columns rowset reader should return
const std::vector<uint32_t>* return_columns = nullptr;
TPushAggOp::type push_down_agg_type_opt = TPushAggOp::NONE;
@@ -108,6 +106,9 @@ struct RowsetReaderContext {
// When true, push down value predicates for MOR tables
bool enable_mor_value_predicate_pushdown = false;
+
+ // General LIMIT budget forwarded to SegmentIterator.
+ int64_t general_read_limit = -1;
};
} // namespace doris
diff --git a/be/src/storage/segment/segment_iterator.cpp b/be/src/storage/segment/segment_iterator.cpp
index 1ca5dcb9e93..bec2c7f34ba 100644
--- a/be/src/storage/segment/segment_iterator.cpp
+++ b/be/src/storage/segment/segment_iterator.cpp
@@ -1659,7 +1659,7 @@ bool SegmentIterator::_should_engage_count_emit_shortcut(const Block* block) {
facts.lazy_materialization_read = _lazy_materialization_read;
facts.has_virtual_columns = !_virtual_column_exprs.empty();
facts.record_rowids = _opts.record_rowids || _record_rowids;
- facts.has_read_limit = false;
+ facts.has_read_limit = _opts.read_limit > 0;
facts.read_orderby_key_reverse = _opts.read_orderby_key_reverse;
facts.has_condition_cache_digest = _opts.condition_cache_digest != 0;
facts.block_shape_matches_schema = block->columns() == _schema->num_column_ids();
@@ -1895,12 +1895,6 @@ Status SegmentIterator::_apply_inverted_index() {
*/
bool SegmentIterator::_check_all_conditions_passed_inverted_index_for_column(ColumnId cid,
bool default_return) {
- // If common_expr_pushdown is disabled, we cannot guarantee that all conditions are processed by the inverted index.
- // Consider a scenario where there is a column predicate and an expression involving the same column in the SQL query,
- // such as 'a < 0' and 'abs(a) > 1'. This could potentially lead to errors.
- if (_opts.runtime_state && !_opts.runtime_state->query_options().enable_common_expr_pushdown) {
- return false;
- }
auto pred_it = _column_predicate_index_exec_status.find(cid);
if (pred_it != _column_predicate_index_exec_status.end()) {
const auto& pred_map = pred_it->second;
@@ -2924,6 +2918,53 @@ uint16_t SegmentIterator::_evaluate_short_circuit_predicate(uint16_t* vec_sel_ro
return selected_size;
}
+static void shrink_materialized_block_columns(Block* block, size_t rows) {
+ for (auto& entry : *block) {
+ if (entry.column && entry.column->size() > rows) {
+ entry.column = entry.column->shrink(rows);
+ }
+ }
+}
+
+static void slice_materialized_block_columns(Block* block, size_t offset, size_t rows,
+ size_t original_rows) {
+ for (auto& entry : *block) {
+ if (!entry.column || entry.column->size() == 0) {
+ continue;
+ }
+ DORIS_CHECK(entry.column->size() == original_rows);
+ entry.column = entry.column->cut(offset, rows);
+ }
+}
+
+Status SegmentIterator::_apply_read_limit_to_selected_rows(Block* block, uint16_t& selected_size) {
+ if (_opts.read_limit == 0) {
+ return Status::OK();
+ }
+ DORIS_CHECK(_rows_returned <= _opts.read_limit);
+ size_t remaining = _opts.read_limit - _rows_returned;
+ if (remaining == 0) {
+ selected_size = 0;
+ shrink_materialized_block_columns(block, 0);
+ return Status::OK();
+ }
+ if (selected_size > remaining) {
+ if (_opts.read_orderby_key_reverse) {
+ const auto original_size = selected_size;
+ const auto offset = original_size - remaining;
+ for (size_t i = 0; i < remaining; ++i) {
+ _sel_rowid_idx[i] = _sel_rowid_idx[offset + i];
+ }
+ selected_size = cast_set<uint16_t>(remaining);
+ slice_materialized_block_columns(block, offset, remaining, original_size);
+ return Status::OK();
+ }
+ selected_size = cast_set<uint16_t>(remaining);
+ shrink_materialized_block_columns(block, selected_size);
+ }
+ return Status::OK();
+}
+
Status SegmentIterator::_read_columns_by_rowids(std::vector<ColumnId>& read_column_ids,
std::vector<rowid_t>& rowid_vector,
uint16_t* sel_rowid_idx, size_t select_size,
@@ -3159,18 +3200,28 @@ Status SegmentIterator::_next_batch_internal(Block* block) {
if (_count_emit_shortcut) {
return _emit_count_shortcut_batch(block);
}
+ if (_opts.read_limit > 0 && _rows_returned >= _opts.read_limit) {
+ return _process_eof(block);
+ }
// If the row bitmap size is smaller than nrows_read_limit, there's no need to reserve that many column rows.
uint32_t nrows_read_limit =
std::min(cast_set<uint32_t>(_row_bitmap.cardinality()), _opts.block_row_max);
- if (_can_opt_topn_reads()) {
- nrows_read_limit = std::min(static_cast<uint32_t>(_opts.topn_limit), nrows_read_limit);
+ if (_can_opt_limit_reads()) {
+ // No SegmentIterator-side conjunct remains to be evaluated, so LIMIT is equivalent before
+ // and after filtering. Cap the first read directly; this is the no-conjunct fast path that
+ // avoids reading rows past the pushed-down local LIMIT.
+ size_t cap = (_opts.read_limit > _rows_returned) ? (_opts.read_limit - _rows_returned) : 0;
+ if (cap < nrows_read_limit) {
+ nrows_read_limit = static_cast<uint32_t>(cap);
+ }
}
DBUG_EXECUTE_IF("segment_iterator.topn_opt_1", {
if (nrows_read_limit != 1) {
return Status::Error<ErrorCode::INTERNAL_ERROR>(
- "topn opt 1 execute failed: nrows_read_limit={}, _opts.topn_limit={}",
- nrows_read_limit, _opts.topn_limit);
+ "topn opt 1 execute failed: nrows_read_limit={}, "
+ "_opts.read_limit={}",
+ nrows_read_limit, _opts.read_limit);
}
})
@@ -3246,6 +3297,8 @@ Status SegmentIterator::_next_batch_internal(Block* block) {
RETURN_IF_ERROR(_process_common_expr(_sel_rowid_idx.data(), _selected_size, block));
}
+ RETURN_IF_ERROR(_apply_read_limit_to_selected_rows(block, _selected_size));
+
// step4: read non_predicate column
if (_selected_size > 0) {
if (!_non_predicate_columns.empty()) {
@@ -3284,6 +3337,9 @@ Status SegmentIterator::_next_batch_internal(Block* block) {
_output_index_result_column(vir_ctxs, sel_rowid_idx, _selected_size, block);
}
RETURN_IF_ERROR(_materialization_of_virtual_column(block));
+ if (_opts.read_limit > 0) {
+ _rows_returned += block->rows();
+ }
return _check_output_block(block);
}
@@ -3823,8 +3879,15 @@ bool SegmentIterator::_has_delete_predicate(ColumnId cid) {
return delete_columns_set.contains(cid);
}
-bool SegmentIterator::_can_opt_topn_reads() {
- if (_opts.topn_limit <= 0) {
+bool SegmentIterator::_can_opt_limit_reads() {
+ if (_opts.read_limit == 0) {
+ return false;
+ }
+
+ // If SegmentIterator still needs to evaluate predicates/common exprs, LIMIT must be applied to
+ // post-filter rows by _apply_read_limit_to_selected_rows(); capping the raw read here could
+ // return fewer rows than the query LIMIT.
+ if (_is_need_vec_eval || _is_need_short_eval || _is_need_expr_eval) {
return false;
}
diff --git a/be/src/storage/segment/segment_iterator.h b/be/src/storage/segment/segment_iterator.h
index 870f1ed5a66..097db1632c6 100644
--- a/be/src/storage/segment/segment_iterator.h
+++ b/be/src/storage/segment/segment_iterator.h
@@ -254,6 +254,7 @@ private:
uint32_t nrows_read_limit);
uint16_t _evaluate_vectorization_predicate(uint16_t* sel_rowid_idx, uint16_t selected_size);
uint16_t _evaluate_short_circuit_predicate(uint16_t* sel_rowid_idx, uint16_t selected_size);
+ Status _apply_read_limit_to_selected_rows(Block* block, uint16_t& selected_size);
void _collect_runtime_filter_predicate();
Status _output_non_pred_columns(Block* block);
[[nodiscard]] Status _read_columns_by_rowids(std::vector<ColumnId>& read_column_ids,
@@ -354,7 +355,7 @@ private:
bool _has_delete_predicate(ColumnId cid);
- bool _can_opt_topn_reads();
+ bool _can_opt_limit_reads();
void _initialize_predicate_results();
bool _check_all_conditions_passed_inverted_index_for_column(ColumnId cid,
@@ -471,6 +472,10 @@ private:
uint16_t _selected_size;
std::vector<uint16_t> _sel_rowid_idx;
+ // Rows already produced by this iterator. Used together with
+ // _opts.read_limit to compute the remaining per-batch budget.
+ size_t _rows_returned = 0;
+
std::unique_ptr<ObjectPool> _pool;
// used to collect filter information.
diff --git a/be/src/storage/tablet/tablet_reader.cpp b/be/src/storage/tablet/tablet_reader.cpp
index 7118e1aad8d..6b1ede06ac1 100644
--- a/be/src/storage/tablet/tablet_reader.cpp
+++ b/be/src/storage/tablet/tablet_reader.cpp
@@ -158,7 +158,6 @@ Status TabletReader::_capture_rs_readers(const ReaderParams& read_params) {
_reader_context.topn_filter_target_node_id = read_params.topn_filter_target_node_id;
_reader_context.read_orderby_key_reverse = read_params.read_orderby_key_reverse;
_reader_context.read_orderby_key_limit = read_params.read_orderby_key_limit;
- _reader_context.filter_block_conjuncts = read_params.filter_block_conjuncts;
_reader_context.return_columns = &_return_columns;
_reader_context.read_orderby_key_columns =
!_orderby_key_columns.empty() ? &_orderby_key_columns : nullptr;
@@ -197,6 +196,8 @@ Status TabletReader::_capture_rs_readers(const ReaderParams& read_params) {
_reader_context.predicate_access_paths = read_params.predicate_access_paths;
_reader_context.condition_cache_digest = read_params.condition_cache_digest;
+ // Propagate general read limit for DUP_KEYS and UNIQUE_KEYS with MOW
+ _reader_context.general_read_limit = read_params.general_read_limit;
return Status::OK();
}
@@ -428,6 +429,16 @@ Status TabletReader::_init_orderby_keys_param(const ReaderParams& read_params) {
}
}
+ // Storage TopN sorts rows by these columns, and only DUP and merge-on-write tablets set
+ // them up. Without them, fail the scan here instead of aborting later in VCollectIterator.
+ if (read_params.read_orderby_key_limit > 0 && _orderby_key_columns.empty()) {
+ return Status::Error<ErrorCode::INTERNAL_ERROR>(
+ "storage TopN needs order-by key columns, but none are set up: keys_type={}, "
+ "enable_unique_key_merge_on_write={}, read_orderby_key_num_prefix_columns={}",
+ _tablet_schema->keys_type(), _tablet->enable_unique_key_merge_on_write(),
+ read_params.read_orderby_key_num_prefix_columns);
+ }
+
return Status::OK();
}
diff --git a/be/src/storage/tablet/tablet_reader.h b/be/src/storage/tablet/tablet_reader.h
index 4d4773f939d..d5798cc618d 100644
--- a/be/src/storage/tablet/tablet_reader.h
+++ b/be/src/storage/tablet/tablet_reader.h
@@ -180,9 +180,6 @@ public:
size_t read_orderby_key_num_prefix_columns = 0;
// limit of rows for read_orderby_key
size_t read_orderby_key_limit = 0;
- // filter_block arguments
- VExprContextSPtrs filter_block_conjuncts;
-
// for vertical compaction
bool is_key_column_group = false;
std::vector<uint32_t> key_group_cluster_key_idxes;
@@ -211,6 +208,9 @@ public:
std::shared_ptr<segment_v2::AnnTopNRuntime> ann_topn_runtime;
uint64_t condition_cache_digest = 0;
+
+ // General LIMIT budget forwarded to SegmentIterator. -1 means no limit.
+ int64_t general_read_limit = -1;
};
TabletReader() = default;
diff --git a/be/test/storage/segment/segment_iterator_limit_opt_test.cpp b/be/test/storage/segment/segment_iterator_limit_opt_test.cpp
new file mode 100644
index 00000000000..e845d322a36
--- /dev/null
+++ b/be/test/storage/segment/segment_iterator_limit_opt_test.cpp
@@ -0,0 +1,208 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Use #define private public to access private members for white-box testing
+// of SegmentIterator::_can_opt_limit_reads() and its dependent state. Mirrors
+// the convention in segment_iterator_apply_index_expr_test.cpp.
+#include "core/block/block.h"
+#include "core/column/column_vector.h"
+#include "core/data_type/data_type_number.h"
+#include "gtest/gtest.h"
+#include "storage/olap_common.h"
+#include "storage/predicate/block_column_predicate.h"
+#include "storage/predicate/null_predicate.h"
+#include "storage/tablet/tablet_schema.h"
+
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wkeyword-macro"
+#endif
+#define private public
+#define protected public
+#include "storage/segment/segment_iterator.h"
+#undef private
+#undef protected
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
+namespace doris::segment_v2 {
+
+static MutableColumnPtr make_int_column(size_t rows) {
+ auto column = ColumnVector<TYPE_INT>::create();
+ column->reserve(rows);
+ for (size_t i = 0; i < rows; ++i) {
+ column->insert_value(1);
+ }
+ return column;
+}
+
+static MutableColumnPtr make_int_sequence_column(size_t rows) {
+ auto column = ColumnVector<TYPE_INT>::create();
+ column->reserve(rows);
+ for (size_t i = 0; i < rows; ++i) {
+ column->insert_value(cast_set<int32_t>(i));
+ }
+ return column;
+}
+
+class SegmentIteratorLimitOptTest : public ::testing::Test {
+protected:
+ void SetUp() override {
+ TabletSchemaPB schema_pb;
+ schema_pb.set_keys_type(KeysType::DUP_KEYS);
+ auto* col = schema_pb.add_column();
+ col->set_unique_id(0);
+ col->set_name("k1");
+ col->set_type("INT");
+ col->set_is_key(true);
+ col->set_is_nullable(true);
+
+ _tablet_schema = std::make_shared<TabletSchema>();
+ _tablet_schema->init_from_pb(schema_pb);
+ _read_schema =
+ std::make_shared<Schema>(_tablet_schema->columns(), std::vector<ColumnId> {0});
+ }
+
+ // Build a SegmentIterator with minimal opts for _can_opt_limit_reads() testing.
+ // The segment pointer is null — only _opts and internal maps are accessed.
+ std::unique_ptr<SegmentIterator> make_iter() {
+ auto iter = std::make_unique<SegmentIterator>(nullptr, _read_schema);
+ iter->_opts.tablet_schema = _tablet_schema;
+ iter->_opts.stats = &_stats;
+ // delete_condition_predicates is default-constructed (empty)
+ return iter;
+ }
+
+ std::shared_ptr<TabletSchema> _tablet_schema;
+ SchemaSPtr _read_schema;
+ OlapReaderStatistics _stats;
+};
+
+// No limit at all → optimization disabled.
+TEST_F(SegmentIteratorLimitOptTest, no_limit_returns_false) {
+ auto iter = make_iter();
+ iter->_opts.read_limit = 0;
+ EXPECT_FALSE(iter->_can_opt_limit_reads());
+}
+
+// topn_limit > 0, no predicates, no delete conditions → should return true.
+// All columns pass the index check vacuously because
+// _column_predicate_index_exec_status is empty and default_return=true.
+TEST_F(SegmentIteratorLimitOptTest, topn_limit_no_predicates) {
+ auto iter = make_iter();
+ iter->_opts.read_limit = 100;
+ EXPECT_TRUE(iter->_can_opt_limit_reads());
+}
+
+// If SegmentIterator still needs to evaluate a pushed conjunct, raw reads cannot
+// be capped by LIMIT. The limit must be applied after filtering selected rows.
+TEST_F(SegmentIteratorLimitOptTest, pushed_conjunct_requires_post_filter_limit) {
+ auto iter = make_iter();
+ iter->_opts.read_limit = 100;
+ iter->_is_need_expr_eval = true;
+ EXPECT_FALSE(iter->_can_opt_limit_reads());
+
+ iter = make_iter();
+ iter->_opts.read_limit = 100;
+ iter->_is_need_vec_eval = true;
+ EXPECT_FALSE(iter->_can_opt_limit_reads());
+
+ iter = make_iter();
+ iter->_opts.read_limit = 100;
+ iter->_is_need_short_eval = true;
+ EXPECT_FALSE(iter->_can_opt_limit_reads());
+}
+
+TEST_F(SegmentIteratorLimitOptTest, read_limit_shrinks_materialized_columns) {
+ auto iter = make_iter();
+ iter->_opts.read_limit = 20;
+ iter->_rows_returned = 0;
+
+ Block block;
+ block.insert({make_int_column(0), std::make_shared<DataTypeInt32>(), "not_materialized"});
+ block.insert({make_int_column(100), std::make_shared<DataTypeInt32>(), "delete_sign"});
+ uint16_t selected_size = 100;
+
+ ASSERT_TRUE(iter->_apply_read_limit_to_selected_rows(&block, selected_size).ok());
+ EXPECT_EQ(20, selected_size);
+ EXPECT_EQ(0, block.get_by_position(0).column->size());
+ EXPECT_EQ(20, block.get_by_position(1).column->size());
+}
+
+TEST_F(SegmentIteratorLimitOptTest, reverse_read_limit_keeps_suffix_rows) {
+ auto iter = make_iter();
+ iter->_opts.read_limit = 20;
+ iter->_opts.read_orderby_key_reverse = true;
+ iter->_rows_returned = 0;
+ iter->_sel_rowid_idx.resize(100);
+ for (uint16_t i = 0; i < 100; ++i) {
+ iter->_sel_rowid_idx[i] = i;
+ }
+
+ Block block;
+ block.insert({make_int_sequence_column(100), std::make_shared<DataTypeInt32>(), "k1"});
+ uint16_t selected_size = 100;
+
+ ASSERT_TRUE(iter->_apply_read_limit_to_selected_rows(&block, selected_size).ok());
+ EXPECT_EQ(20, selected_size);
+ EXPECT_EQ(20, block.get_by_position(0).column->size());
+ EXPECT_EQ(80, assert_cast<const ColumnVector<TYPE_INT>*>(block.get_by_position(0).column.get())
+ ->get_data()[0]);
+ EXPECT_EQ(99, assert_cast<const ColumnVector<TYPE_INT>*>(block.get_by_position(0).column.get())
+ ->get_data()[19]);
+ EXPECT_EQ(80, iter->_sel_rowid_idx[0]);
+ EXPECT_EQ(99, iter->_sel_rowid_idx[19]);
+}
+
+// Has delete condition predicates → should return false even with limit set.
+TEST_F(SegmentIteratorLimitOptTest, delete_predicates_returns_false) {
+ auto iter = make_iter();
+ iter->_opts.read_limit = 100;
+
+ // Add a column predicate to delete_condition_predicates so
+ // num_of_column_predicate() > 0.
+ auto null_pred = NullPredicate::create_shared(0, "k1", true, PrimitiveType::TYPE_INT);
+ auto single = SingleColumnBlockPredicate::create_unique(null_pred);
+ iter->_opts.delete_condition_predicates->add_column_predicate(std::move(single));
+
+ EXPECT_FALSE(iter->_can_opt_limit_reads());
+}
+
+// Column has a predicate that did NOT pass inverted index → should return false.
+TEST_F(SegmentIteratorLimitOptTest, column_predicate_not_passed_index) {
+ auto iter = make_iter();
+ iter->_opts.read_limit = 100;
+
+ auto pred = NullPredicate::create_shared(0, "k1", true, PrimitiveType::TYPE_INT);
+ iter->_column_predicate_index_exec_status[0][pred] = false;
+
+ EXPECT_FALSE(iter->_can_opt_limit_reads());
+}
+
+// Column has a predicate that passed inverted index → should return true.
+TEST_F(SegmentIteratorLimitOptTest, column_predicate_passed_index) {
+ auto iter = make_iter();
+ iter->_opts.read_limit = 100;
+
+ auto pred = NullPredicate::create_shared(0, "k1", true, PrimitiveType::TYPE_INT);
+ iter->_column_predicate_index_exec_status[0][pred] = true;
+
+ EXPECT_TRUE(iter->_can_opt_limit_reads());
+}
+
+} // namespace doris::segment_v2
diff --git a/be/test/storage/tablet_reader_test.cpp b/be/test/storage/tablet_reader_test.cpp
new file mode 100644
index 00000000000..602e06438e7
--- /dev/null
+++ b/be/test/storage/tablet_reader_test.cpp
@@ -0,0 +1,116 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "storage/tablet/tablet_reader.h"
+
+#include <gen_cpp/olap_file.pb.h>
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "storage/storage_engine.h"
+#include "storage/tablet/tablet.h"
+#include "storage/tablet/tablet_meta.h"
+#include "storage/tablet/tablet_schema.h"
+
+namespace doris {
+
+class TabletReaderTest : public testing::Test {
+protected:
+ static TabletSchemaSPtr create_schema(
+ const std::vector<std::pair<std::string, int32_t>>& name_and_uid,
+ KeysType keys_type = KeysType::DUP_KEYS) {
+ TabletSchemaPB schema_pb;
+ schema_pb.set_keys_type(keys_type);
+ bool first = true;
+ for (const auto& [name, uid] : name_and_uid) {
+ auto* col = schema_pb.add_column();
+ col->set_unique_id(uid);
+ col->set_name(name);
+ col->set_type("INT");
+ col->set_is_key(first);
+ col->set_is_nullable(!first);
+ first = false;
+ }
+ auto schema = std::make_shared<TabletSchema>();
+ schema->init_from_pb(schema_pb);
+ return schema;
+ }
+
+ // Give `reader` a tablet with the given keys type. Its only key column is k1, and the
+ // reader returns both columns.
+ static void init_tablet(StorageEngine& engine, TabletReader& reader, KeysType keys_type,
+ bool enable_mow) {
+ auto tablet_meta = std::make_shared<TabletMeta>();
+ tablet_meta->set_enable_unique_key_merge_on_write(enable_mow);
+ reader._tablet = std::make_shared<Tablet>(engine, std::move(tablet_meta), nullptr);
+ reader._tablet_schema = create_schema({{"k1", 10}, {"v1", 12}}, keys_type);
+ reader._return_columns = {0, 1};
+ }
+
+ // Set up the order-by key columns for a storage TopN that sorts by the first
+ // `num_prefix_columns` key columns.
+ static Status init_storage_topn(TabletReader& reader, size_t num_prefix_columns) {
+ TabletReader::ReaderParams params;
+ params.read_orderby_key_num_prefix_columns = num_prefix_columns;
+ params.read_orderby_key_limit = 10;
+ return reader._init_orderby_keys_param(params);
+ }
+};
+
+// DUP and merge-on-write tablets give storage TopN the leading key columns to sort by.
+TEST_F(TabletReaderTest, storage_topn_sorts_by_leading_key_columns) {
+ StorageEngine engine({});
+ TabletReader dup_reader;
+ init_tablet(engine, dup_reader, KeysType::DUP_KEYS, /*enable_mow=*/false);
+ auto st = init_storage_topn(dup_reader, 1);
+ ASSERT_TRUE(st.ok()) << st;
+ EXPECT_EQ(std::vector<uint32_t>({0}), dup_reader._orderby_key_columns);
+
+ TabletReader mow_reader;
+ init_tablet(engine, mow_reader, KeysType::UNIQUE_KEYS, /*enable_mow=*/true);
+ st = init_storage_topn(mow_reader, 1);
+ ASSERT_TRUE(st.ok()) << st;
+ EXPECT_EQ(std::vector<uint32_t>({0}), mow_reader._orderby_key_columns);
+}
+
+// Storage TopN without order-by key columns fails at init, instead of aborting the BE
+// later in VCollectIterator.
+TEST_F(TabletReaderTest, storage_topn_without_orderby_key_columns_fails) {
+ StorageEngine engine({});
+ // A merge-on-read tablet, such as one read as DUP, sets up no order-by key columns.
+ TabletReader mor_reader;
+ init_tablet(engine, mor_reader, KeysType::UNIQUE_KEYS, /*enable_mow=*/false);
+ auto st = init_storage_topn(mor_reader, 1);
+ EXPECT_TRUE(st.is<ErrorCode::INTERNAL_ERROR>()) << st;
+
+ // An empty key prefix leaves nothing to sort by.
+ TabletReader dup_reader;
+ init_tablet(engine, dup_reader, KeysType::DUP_KEYS, /*enable_mow=*/false);
+ st = init_storage_topn(dup_reader, 0);
+ EXPECT_TRUE(st.is<ErrorCode::INTERNAL_ERROR>()) << st;
+
+ // Without TopN, a merge-on-read tablet needs no order-by key columns.
+ TabletReader plain_reader;
+ init_tablet(engine, plain_reader, KeysType::UNIQUE_KEYS, /*enable_mow=*/false);
+ st = plain_reader._init_orderby_keys_param(TabletReader::ReaderParams {});
+ EXPECT_TRUE(st.ok()) << st;
+}
+} // namespace doris
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index e1c3f36d0e5..768e419a639 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -485,7 +485,7 @@ public class SessionVariable implements Serializable, Writable {
public static final String ENABLE_EXT_FUNC_PRED_PUSHDOWN = "enable_ext_func_pred_pushdown";
- public static final String ENABLE_COMMON_EXPR_PUSHDOWN = "enable_common_expr_pushdown";
+ public static final String ENABLE_SEGMENT_LIMIT_PUSHDOWN = "enable_segment_limit_pushdown";
public static final String FRAGMENT_TRANSMISSION_COMPRESSION_CODEC = "fragment_transmission_compression_codec";
@@ -549,9 +549,6 @@ public class SessionVariable implements Serializable, Writable {
public static final String ENABLE_INVERTED_INDEX_QUERY = "enable_inverted_index_query";
- public static final String ENABLE_COMMON_EXPR_PUSHDOWN_FOR_INVERTED_INDEX
- = "enable_common_expr_pushdown_for_inverted_index";
-
public static final String ENABLE_PUSHDOWN_COUNT_ON_INDEX = "enable_count_on_index_pushdown";
public static final String ENABLE_NO_NEED_READ_DATA_OPT = "enable_no_need_read_data_opt";
@@ -2301,8 +2298,9 @@ public class SessionVariable implements Serializable, Writable {
@VariableMgr.VarAttr(name = FORBID_UNKNOWN_COLUMN_STATS)
public boolean forbidUnknownColStats = false;
- @VariableMgr.VarAttr(name = ENABLE_COMMON_EXPR_PUSHDOWN, fuzzy = true)
- public boolean enableCommonExprPushdown = true;
+ @VariableMgr.VarAttr(name = ENABLE_SEGMENT_LIMIT_PUSHDOWN, fuzzy = true, needForward = true, description = {
+ "是否启用 SegmentIterator 层 LIMIT 下推。", "Set whether to push down LIMIT into SegmentIterator."})
+ public boolean enableSegmentLimitPushdown = true;
@VariableMgr.VarAttr(name = ENABLE_LOCAL_EXCHANGE, fuzzy = false, flag = VariableMgr.INVISIBLE,
varType = VariableAnnotation.DEPRECATED)
@@ -2467,11 +2465,6 @@ public class SessionVariable implements Serializable, Writable {
"是否启用 inverted index query。", "Set whether to use inverted index query."})
public boolean enableInvertedIndexQuery = true;
- // Whether enable query expr with inverted index.
- @VariableMgr.VarAttr(name = ENABLE_COMMON_EXPR_PUSHDOWN_FOR_INVERTED_INDEX, fuzzy = true, needForward = true,
- description = {"是否启用表达式上使用 inverted index。", "Set whether to use inverted index query for expr."})
- public boolean enableCommonExpPushDownForInvertedIndex = true;
-
// Whether enable pushdown count agg to scan node when using inverted index match.
@VariableMgr.VarAttr(name = ENABLE_PUSHDOWN_COUNT_ON_INDEX, needForward = true, description = {
"是否启用 count_on_index pushdown。", "Set whether to pushdown count_on_index."})
@@ -3940,11 +3933,10 @@ public class SessionVariable implements Serializable, Writable {
this.enableConditionCache = Config.pull_request_id % 2 == 0;
this.parallelPipelineTaskNum = random.nextInt(8);
this.parallelPrepareThreshold = random.nextInt(32) + 1;
- this.enableCommonExprPushdown = random.nextBoolean();
+ this.enableSegmentLimitPushdown = random.nextBoolean();
this.enableLocalExchange = random.nextBoolean();
this.enableSharedExchangeSinkBuffer = random.nextBoolean();
this.useSerialExchange = random.nextBoolean();
- this.enableCommonExpPushDownForInvertedIndex = random.nextBoolean();
this.enableExprZonemapFilter = Config.pull_request_id % 2 == 0;
// Fuzzy sessions must exercise the production-default V2 path consistently. Dedicated
// compatibility cases can still select the legacy scanner explicitly after initialization.
@@ -5706,16 +5698,6 @@ public class SessionVariable implements Serializable, Writable {
this.enableInvertedIndexQuery = enableInvertedIndexQuery;
}
-
- public boolean isEnableCommonExprPushdownForInvertedIndex() {
- return enableCommonExpPushDownForInvertedIndex;
- }
-
-
- public void setEnableCommonExprPushdownForInvertedIndex(boolean enableCommonExpPushDownForInvertedIndex) {
- this.enableCommonExpPushDownForInvertedIndex = enableCommonExpPushDownForInvertedIndex;
- }
-
public boolean isEnablePushDownCountOnIndex() {
return enablePushDownCountOnIndex;
}
@@ -5875,7 +5857,7 @@ public class SessionVariable implements Serializable, Writable {
}
tResult.setEnableFunctionPushdown(enableFunctionPushdown);
- tResult.setEnableCommonExprPushdown(enableCommonExprPushdown);
+ tResult.setEnableSegmentLimitPushdown(enableSegmentLimitPushdown);
tResult.setCheckOverflowForDecimal(checkOverflowForDecimal);
tResult.setFragmentTransmissionCompressionCodec(fragmentTransmissionCompressionCodec.trim().toLowerCase());
tResult.setEnableLocalExchange(enableLocalExchange);
@@ -5896,7 +5878,6 @@ public class SessionVariable implements Serializable, Writable {
tResult.setFileCacheBasePath(fileCacheBasePath);
tResult.setEnableInvertedIndexQuery(enableInvertedIndexQuery);
- tResult.setEnableCommonExprPushdownForInvertedIndex(enableCommonExpPushDownForInvertedIndex);
tResult.setEnableNoNeedReadDataOpt(enableNoNeedReadDataOpt);
tResult.setForcePushdownZonemapMinmax(forcePushDownZonemapMinMax);
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java b/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
index c293aa0d4e6..b0e328b4b82 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
@@ -41,6 +41,7 @@ import org.apache.doris.statistics.util.StatisticsUtil;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -145,6 +146,19 @@ public class VariableMgr {
private static final Lock rlock = rwlock.readLock();
private static final Lock wlock = rwlock.writeLock();
+ // Session variables that have been removed from SessionVariable.java but may still appear in
+ // user scripts, JDBC client connection init, or older replayed-edit logs. Looking up these
+ // names by SET or SELECT @@ silently no-ops instead of throwing ERR_UNKNOWN_SYSTEM_VARIABLE,
+ // so a BE-then-FE rolling upgrade does not break existing workloads. All entries in this set
+ // must use lowercase to match the case-insensitive comparison.
+ private static final ImmutableSet<String> REMOVED_SESSION_VAR_NAMES = ImmutableSet.of(
+ "enable_common_expr_pushdown",
+ "enable_common_expr_pushdown_for_inverted_index");
+
+ private static boolean isRemovedSessionVar(String varName) {
+ return varName != null && REMOVED_SESSION_VAR_NAMES.contains(varName.toLowerCase());
+ }
+
// Form map from variable name to its field in Java class.
static {
// Session value
@@ -302,6 +316,13 @@ public class VariableMgr {
throws DdlException {
VarContext varCtx = getVarContext(setVar.getVariable());
if (varCtx == null) {
+ // Silently ignore variables that have been removed from SessionVariable.
+ // This preserves backward compatibility for clients still issuing SET on the old name
+ // during a BE-then-FE rolling upgrade.
+ if (isRemovedSessionVar(setVar.getVariable())) {
+ LOG.debug("Ignoring removed session variable: {}", setVar.getVariable());
+ return;
+ }
// Check if the variable is in the MySQL compatibility whitelist
if (isInMySQLCompatWhitelist(setVar.getVariable())) {
// Silently ignore whitelisted variables for MySQL compatibility
@@ -347,6 +368,10 @@ public class VariableMgr {
throws DdlException {
VarContext varCtx = getVarContext(setVar.getVariable());
if (varCtx == null) {
+ if (isRemovedSessionVar(setVar.getVariable())) {
+ LOG.debug("Ignoring removed session variable: {}", setVar.getVariable());
+ return;
+ }
// Check if the variable is in the MySQL compatibility whitelist
if (isInMySQLCompatWhitelist(setVar.getVariable())) {
// Silently ignore whitelisted variables for MySQL compatibility
@@ -528,6 +553,13 @@ public class VariableMgr {
public static void fillValue(SessionVariable var, VariableExpr desc) throws AnalysisException {
VarContext ctx = getVarContext(desc.getName());
if (ctx == null) {
+ if (isRemovedSessionVar(desc.getName())) {
+ // Treat removed session variables as empty string for read access,
+ // preserving compatibility with clients that still SELECT @@<removed_var>.
+ desc.setType(Type.VARCHAR);
+ desc.setStringValue("");
+ return;
+ }
ErrorReport.reportAnalysisException(ErrorCode.ERR_UNKNOWN_SYSTEM_VARIABLE, desc.getName());
}
@@ -605,6 +637,9 @@ public class VariableMgr {
private static String getValue(SessionVariable var, String name, SetType setType) throws AnalysisException {
VarContext ctx = ctxByVarName.get(name);
if (ctx == null) {
+ if (isRemovedSessionVar(name)) {
+ return "";
+ }
ErrorReport.reportAnalysisException(ErrorCode.ERR_UNKNOWN_SYSTEM_VARIABLE, name);
}
@@ -628,6 +663,12 @@ public class VariableMgr {
// For Nereids optimizer
public static @Nullable Literal getLiteral(SessionVariable var, String name, SetType setType) {
+ if (isRemovedSessionVar(name)) {
+ // Match the no-op behavior used by setVar/getValue for removed session
+ // variables so that SELECT @@<removed_var> doesn't break clients during
+ // a BE-then-FE rolling upgrade.
+ return new org.apache.doris.nereids.trees.expressions.literal.StringLiteral("");
+ }
VarContext ctx = getVarContext(name);
if (ctx == null) {
return null;
diff --git a/gensrc/thrift/PaloInternalService.thrift b/gensrc/thrift/PaloInternalService.thrift
index c86e01dcb5e..ba02d8fdb9a 100644
--- a/gensrc/thrift/PaloInternalService.thrift
+++ b/gensrc/thrift/PaloInternalService.thrift
@@ -209,7 +209,7 @@ struct TQueryOptions {
64: optional bool dry_run_query = false
- 65: optional bool enable_common_expr_pushdown = false;
+ 65: optional bool enable_common_expr_pushdown = false; // deprecated
66: optional i32 parallel_instance = 1
// Indicate where useServerPrepStmts enabled
@@ -515,6 +515,9 @@ struct TQueryOptions {
229: optional bool enable_paimon_rust_reader = false;
230: optional bool enable_prune_nested_column = false;
+
+ // Push LIMIT into SegmentIterator when safe.
+ 231: optional bool enable_segment_limit_pushdown = true
// For cloud, to control if the content would be written into file cache
// In write path, to control if the content would be written into file cache.
// In read path, read from file cache or remote storage when execute query.
diff --git a/regression-test/data/query_p0/limit/test_general_limit_pushdown.out b/regression-test/data/query_p0/limit/test_general_limit_pushdown.out
new file mode 100644
index 00000000000..2c9afe75210
--- /dev/null
+++ b/regression-test/data/query_p0/limit/test_general_limit_pushdown.out
@@ -0,0 +1,131 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !dup_basic_limit --
+1 99
+10 90
+2 98
+3 97
+4 96
+5 95
+6 94
+7 93
+8 92
+9 91
+
+-- !dup_filter_limit --
+11 89
+12 88
+13 87
+14 86
+15 85
+16 84
+17 83
+18 82
+19 81
+20 80
+21 79
+22 78
+23 77
+24 76
+25 75
+
+-- !dup_filter_over_limit --
+46 54
+47 53
+48 52
+49 51
+50 50
+
+-- !dup_complex_filter_limit --
+16 84
+17 83
+18 82
+19 81
+20 80
+21 79
+22 78
+23 77
+
+-- !mow_basic_limit --
+1 99
+10 90
+2 98
+3 97
+4 96
+5 95
+6 94
+7 93
+8 92
+9 91
+
+-- !mow_filter_limit --
+11 89
+12 88
+13 87
+14 86
+15 85
+16 84
+17 83
+18 82
+19 81
+20 80
+21 79
+22 78
+23 77
+24 76
+25 75
+
+-- !mow_complex_filter_limit --
+16 84
+17 83
+18 82
+19 81
+20 80
+21 79
+22 78
+23 77
+
+-- !agg_basic_limit --
+1 1 30
+2 2 70
+
+-- !mor_filter_limit --
+11 89
+12 88
+13 87
+14 86
+15 85
+16 84
+17 83
+18 82
+19 81
+20 80
+
+-- !mow_delete_limit --
+21 79
+22 78
+23 77
+24 76
+25 75
+26 74
+27 73
+28 72
+29 71
+30 70
+31 69
+32 68
+33 67
+34 66
+35 65
+
+-- !dup_limit_offset --
+10 90
+11 89
+12 88
+13 87
+14 86
+15 85
+6 94
+7 93
+8 92
+9 91
+
diff --git a/regression-test/data/query_p0/limit/test_unified_limit_pushdown.out b/regression-test/data/query_p0/limit/test_unified_limit_pushdown.out
new file mode 100644
index 00000000000..386e4b44a93
--- /dev/null
+++ b/regression-test/data/query_p0/limit/test_unified_limit_pushdown.out
@@ -0,0 +1,43 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !topn_asc --
+1 999
+10 990
+2 998
+3 997
+4 996
+5 995
+6 994
+7 993
+8 992
+9 991
+
+-- !topn_desc_filter --
+186 814
+187 813
+188 812
+189 811
+190 810
+191 809
+192 808
+193 807
+194 806
+195 805
+196 804
+197 803
+198 802
+199 801
+200 800
+
+-- !topn_multi_bucket --
+1 9999
+10 9990
+11 9989
+12 9988
+2 9998
+3 9997
+4 9996
+5 9995
+6 9994
+7 9993
+8 9992
+9 9991
diff --git a/regression-test/data/search/test_search_slash_in_term.out b/regression-test/data/search/test_search_slash_in_term.out
index 3b0d6acd7bf..58a4cce9add 100644
--- a/regression-test/data/search/test_search_slash_in_term.out
+++ b/regression-test/data/search/test_search_slash_in_term.out
@@ -1,4 +1,9 @@
-- This file is automatically generated. You should know what you did if you want to edit this
+-- !segment_limit_disabled_still_pushes_search --
+1
+2
+3
+
-- !slash_in_term --
1 AC/DC is a rock band
2 AC power supply
diff --git a/regression-test/data/unique_with_mor_p0/test_read_mor_as_dup_key_topn.out b/regression-test/data/unique_with_mor_p0/test_read_mor_as_dup_key_topn.out
new file mode 100644
index 00000000000..2955af22da3
--- /dev/null
+++ b/regression-test/data/unique_with_mor_p0/test_read_mor_as_dup_key_topn.out
@@ -0,0 +1,35 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !merged --
+1 1 12
+2 2 20
+3 3 30
+
+-- !dup_asc --
+1 1 10
+1 1 11
+1 1 12
+2 2 20
+
+-- !dup_desc --
+7 7 70
+6 6 60
+5 5 50
+
+-- !dup_prefix --
+1 1 10
+1 1 11
+1 1 12
+2 2 20
+
+-- !dup_filter --
+1 1 11
+1 1 12
+2 2 20
+
+-- !dup_offset --
+2 2 20
+3 3 30
+
+-- !dup_limit --
+5
+
diff --git a/regression-test/data/variant_p0/predefine/test_predefine_type_index.out b/regression-test/data/variant_p0/predefine/test_predefine_type_index.out
index 1f8f349929e..15f91208478 100644
--- a/regression-test/data/variant_p0/predefine/test_predefine_type_index.out
+++ b/regression-test/data/variant_p0/predefine/test_predefine_type_index.out
@@ -16,6 +16,14 @@
4 {"path":{"decimal":100.100123456789,"int":100,"string":"world"}}
5 {"path":{"decimal":111.111111111111,"int":111,"string":"hello"}}
+-- !count_on_index_with_segment_limit_disabled --
+1
+
+-- !match_with_segment_limit_disabled --
+1
+3
+5
+
-- !sql --
1
diff --git a/regression-test/suites/ann_index_p0/ann_const_expr_vector.groovy b/regression-test/suites/ann_index_p0/ann_const_expr_vector.groovy
index 380ac4cc40e..258060af258 100644
--- a/regression-test/suites/ann_index_p0/ann_const_expr_vector.groovy
+++ b/regression-test/suites/ann_index_p0/ann_const_expr_vector.groovy
@@ -20,7 +20,7 @@
// Covers: array_repeat, array_with_constant, nested function calls, etc.
suite("ann_const_expr_vector") {
sql "unset variable all;"
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
def tableName = "ann_const_expr_tbl"
diff --git a/regression-test/suites/ann_index_p0/ann_index_basic.groovy b/regression-test/suites/ann_index_p0/ann_index_basic.groovy
index 41ae9e5c309..d5b9fe31670 100644
--- a/regression-test/suites/ann_index_p0/ann_index_basic.groovy
+++ b/regression-test/suites/ann_index_p0/ann_index_basic.groovy
@@ -19,7 +19,7 @@
// Includes range search, topn search, and compound search
suite ("ann_index_basic") {
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
// 1) Basic L2 ANN table: dim=3
sql "drop table if exists basic_tbl_ann_l2"
diff --git a/regression-test/suites/ann_index_p0/ann_index_build_min_segment_rows.groovy b/regression-test/suites/ann_index_p0/ann_index_build_min_segment_rows.groovy
index 01393444830..4051e008940 100644
--- a/regression-test/suites/ann_index_p0/ann_index_build_min_segment_rows.groovy
+++ b/regression-test/suites/ann_index_p0/ann_index_build_min_segment_rows.groovy
@@ -17,7 +17,7 @@
suite("ann_index_build_min_segment_rows", "nonConcurrent") {
sql "unset variable all;"
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql "set experimental_enable_virtual_slot_for_cse=true;"
sql "set enable_no_need_read_data_opt=true;"
sql "set parallel_pipeline_task_num=1;"
diff --git a/regression-test/suites/ann_index_p0/ann_index_only_scan_compound_debug_point.groovy b/regression-test/suites/ann_index_p0/ann_index_only_scan_compound_debug_point.groovy
index 89482e14856..f55314f657f 100644
--- a/regression-test/suites/ann_index_p0/ann_index_only_scan_compound_debug_point.groovy
+++ b/regression-test/suites/ann_index_p0/ann_index_only_scan_compound_debug_point.groovy
@@ -17,7 +17,7 @@
suite("ann_index_only_scan_compound_debug_point", "nonConcurrent") {
sql "unset variable all;"
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql "set experimental_enable_virtual_slot_for_cse=true;"
sql "set enable_no_need_read_data_opt=true;"
sql "set parallel_pipeline_task_num=1;"
diff --git a/regression-test/suites/ann_index_p0/ann_index_only_scan_debug_point.groovy b/regression-test/suites/ann_index_p0/ann_index_only_scan_debug_point.groovy
index 96fb5514e7e..a279ff55052 100644
--- a/regression-test/suites/ann_index_p0/ann_index_only_scan_debug_point.groovy
+++ b/regression-test/suites/ann_index_p0/ann_index_only_scan_debug_point.groovy
@@ -17,7 +17,7 @@
suite("ann_index_only_scan_debug_point", "nonConcurrent") {
sql "unset variable all;"
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql "set experimental_enable_virtual_slot_for_cse=true;"
sql "set enable_no_need_read_data_opt=true;"
sql "set parallel_pipeline_task_num=1;"
diff --git a/regression-test/suites/ann_index_p0/ann_index_only_scan_expr_debug_point.groovy b/regression-test/suites/ann_index_p0/ann_index_only_scan_expr_debug_point.groovy
index aea2d9ad3cc..08ae1781f19 100644
--- a/regression-test/suites/ann_index_p0/ann_index_only_scan_expr_debug_point.groovy
+++ b/regression-test/suites/ann_index_p0/ann_index_only_scan_expr_debug_point.groovy
@@ -17,7 +17,7 @@
suite("ann_index_only_scan_expr_debug_point", "nonConcurrent") {
sql "unset variable all;"
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql "set experimental_enable_virtual_slot_for_cse=true;"
sql "set enable_no_need_read_data_opt=true;"
sql "set parallel_pipeline_task_num=1;"
diff --git a/regression-test/suites/ann_index_p0/ann_range_search_pushdown_regression.groovy b/regression-test/suites/ann_index_p0/ann_range_search_pushdown_regression.groovy
index 47c54953dcd..2dc9caa24c8 100644
--- a/regression-test/suites/ann_index_p0/ann_range_search_pushdown_regression.groovy
+++ b/regression-test/suites/ann_index_p0/ann_range_search_pushdown_regression.groovy
@@ -84,7 +84,7 @@ suite("ann_range_search_pushdown_regression", "nonConcurrent") {
}
sql "unset variable all;"
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql "set experimental_enable_virtual_slot_for_cse=true;"
sql "set enable_no_need_read_data_opt=true;"
sql "set enable_profile=true;"
diff --git a/regression-test/suites/ann_index_p0/ann_range_search_source_index_status_regression.groovy b/regression-test/suites/ann_index_p0/ann_range_search_source_index_status_regression.groovy
index ea8fa0769f8..490c7a323d7 100644
--- a/regression-test/suites/ann_index_p0/ann_range_search_source_index_status_regression.groovy
+++ b/regression-test/suites/ann_index_p0/ann_range_search_source_index_status_regression.groovy
@@ -17,7 +17,7 @@
suite("ann_range_search_source_index_status_regression", "nonConcurrent") {
sql "unset variable all;"
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql "set experimental_enable_virtual_slot_for_cse=true;"
sql "set enable_no_need_read_data_opt=true;"
sql "set parallel_pipeline_task_num=1;"
diff --git a/regression-test/suites/ann_index_p0/ann_with_fulltext.groovy b/regression-test/suites/ann_index_p0/ann_with_fulltext.groovy
index 0ac14b0e2b0..df30e8e6fb2 100644
--- a/regression-test/suites/ann_index_p0/ann_with_fulltext.groovy
+++ b/regression-test/suites/ann_index_p0/ann_with_fulltext.groovy
@@ -18,7 +18,7 @@
suite("ann_with_fulltext") {
sql "drop table if exists ann_with_fulltext"
sql "set profile_level=2;"
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql """
create table ann_with_fulltext (
diff --git a/regression-test/suites/ann_index_p0/build_ann_index_test.groovy b/regression-test/suites/ann_index_p0/build_ann_index_test.groovy
index 26101a60950..bc1197262d0 100644
--- a/regression-test/suites/ann_index_p0/build_ann_index_test.groovy
+++ b/regression-test/suites/ann_index_p0/build_ann_index_test.groovy
@@ -65,7 +65,7 @@ suite("build_ann_index_test") {
return "wait_timeout"
}
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql "drop table if exists table_build_ann_index_test;"
def tableName = "table_build_ann_index_test"
diff --git a/regression-test/suites/ann_index_p0/cast_string_as_array.groovy b/regression-test/suites/ann_index_p0/cast_string_as_array.groovy
index 01a1c4e5f07..4beef347e85 100644
--- a/regression-test/suites/ann_index_p0/cast_string_as_array.groovy
+++ b/regression-test/suites/ann_index_p0/cast_string_as_array.groovy
@@ -17,7 +17,7 @@
suite("cast_string_as_array") {
sql "unset variable all;"
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
// L2 table: dim=3
sql "drop table if exists ann_cast_rhs_l2"
diff --git a/regression-test/suites/ann_index_p0/create_ann_index_test.groovy b/regression-test/suites/ann_index_p0/create_ann_index_test.groovy
index c0dd19813ac..553a57d61e1 100644
--- a/regression-test/suites/ann_index_p0/create_ann_index_test.groovy
+++ b/regression-test/suites/ann_index_p0/create_ann_index_test.groovy
@@ -16,7 +16,7 @@
// under the License.
suite("create_ann_index_test") {
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql "drop table if exists tbl_not_null"
sql """
CREATE TABLE `tbl_not_null` (
diff --git a/regression-test/suites/ann_index_p0/create_tbl_with_ann_index_test.groovy b/regression-test/suites/ann_index_p0/create_tbl_with_ann_index_test.groovy
index 03c897d2760..4708ca92bf5 100644
--- a/regression-test/suites/ann_index_p0/create_tbl_with_ann_index_test.groovy
+++ b/regression-test/suites/ann_index_p0/create_tbl_with_ann_index_test.groovy
@@ -16,7 +16,7 @@
// under the License.
suite("create_tbl_with_ann_index_test") {
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql "drop table if exists ann_tbl1"
test {
sql """
diff --git a/regression-test/suites/ann_index_p0/delete_where.groovy b/regression-test/suites/ann_index_p0/delete_where.groovy
index 677f713e6f9..6baebf5987a 100644
--- a/regression-test/suites/ann_index_p0/delete_where.groovy
+++ b/regression-test/suites/ann_index_p0/delete_where.groovy
@@ -16,7 +16,7 @@
// under the License.
suite("delete_where_with_ann") {
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql "drop table if exists delete_where_with_ann"
test {
sql """
diff --git a/regression-test/suites/ann_index_p0/insert_with_invalid_array.groovy b/regression-test/suites/ann_index_p0/insert_with_invalid_array.groovy
index 193392d9223..f04a53df4de 100644
--- a/regression-test/suites/ann_index_p0/insert_with_invalid_array.groovy
+++ b/regression-test/suites/ann_index_p0/insert_with_invalid_array.groovy
@@ -16,7 +16,7 @@
// under the License.
suite("insert_with_invalid_array") {
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql "drop table if exists insert_with_invalid_array"
test {
sql """
diff --git a/regression-test/suites/ann_index_p0/ivf_index_test.groovy b/regression-test/suites/ann_index_p0/ivf_index_test.groovy
index 58eda2f2fce..b47661f2c3e 100644
--- a/regression-test/suites/ann_index_p0/ivf_index_test.groovy
+++ b/regression-test/suites/ann_index_p0/ivf_index_test.groovy
@@ -16,7 +16,7 @@
// under the License.
suite ("ivf_index_test") {
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
// IVF index
sql "drop table if exists ivf_tbl_ann_l2"
diff --git a/regression-test/suites/ann_index_p0/ivf_on_disk_index_test.groovy b/regression-test/suites/ann_index_p0/ivf_on_disk_index_test.groovy
index 63fab34d072..c58a1615130 100644
--- a/regression-test/suites/ann_index_p0/ivf_on_disk_index_test.groovy
+++ b/regression-test/suites/ann_index_p0/ivf_on_disk_index_test.groovy
@@ -16,7 +16,7 @@
// under the License.
suite ("ivf_on_disk_index_test") {
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
// ========== IVF_ON_DISK with L2 distance ==========
sql "drop table if exists tbl_ivf_on_disk_l2"
diff --git a/regression-test/suites/ann_index_p0/ivf_pq_full_buffer_train_recall.groovy b/regression-test/suites/ann_index_p0/ivf_pq_full_buffer_train_recall.groovy
index 166ecb7dc26..ea5ba8006a8 100644
--- a/regression-test/suites/ann_index_p0/ivf_pq_full_buffer_train_recall.groovy
+++ b/regression-test/suites/ann_index_p0/ivf_pq_full_buffer_train_recall.groovy
@@ -16,7 +16,7 @@
// under the License.
suite("ivf_pq_full_buffer_train_recall", "nonConcurrent") {
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql "set ivf_nprobe=8;"
sql "drop table if exists tbl_ivf_pq_full_buffer_train_recall"
diff --git a/regression-test/suites/ann_index_p0/ivf_pq_recall.groovy b/regression-test/suites/ann_index_p0/ivf_pq_recall.groovy
index bf760fb6ef9..813b5044c49 100644
--- a/regression-test/suites/ann_index_p0/ivf_pq_recall.groovy
+++ b/regression-test/suites/ann_index_p0/ivf_pq_recall.groovy
@@ -16,7 +16,7 @@
// under the License.
suite("ivf_pq_recall", "nonConcurrent") {
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql "set ivf_nprobe=8;"
sql "drop table if exists ivf_pq_recall"
diff --git a/regression-test/suites/ann_index_p0/memtbl_on_sink.groovy b/regression-test/suites/ann_index_p0/memtbl_on_sink.groovy
index efa88a3a5dc..39bbe6f4cb0 100644
--- a/regression-test/suites/ann_index_p0/memtbl_on_sink.groovy
+++ b/regression-test/suites/ann_index_p0/memtbl_on_sink.groovy
@@ -16,7 +16,7 @@
// under the License.
suite("memtbl_on_sink") {
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
sql "drop table if exists memtbl_on_sink"
test {
sql """
diff --git a/regression-test/suites/ann_index_p0/quantizer_min_train_rows.groovy b/regression-test/suites/ann_index_p0/quantizer_min_train_rows.groovy
index 15999e5445c..6b7301c79bd 100644
--- a/regression-test/suites/ann_index_p0/quantizer_min_train_rows.groovy
+++ b/regression-test/suites/ann_index_p0/quantizer_min_train_rows.groovy
@@ -16,7 +16,7 @@
// under the License.
suite("quantizer_min_train_rows") {
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
// Test PQ quantizer minimum training rows requirement
// PQ min_train_rows formula is (1 << pq_nbits) * 100.
diff --git a/regression-test/suites/ann_index_p0/small_segment.groovy b/regression-test/suites/ann_index_p0/small_segment.groovy
index cb40ba951f2..2650890386e 100644
--- a/regression-test/suites/ann_index_p0/small_segment.groovy
+++ b/regression-test/suites/ann_index_p0/small_segment.groovy
@@ -16,7 +16,7 @@
// under the License.
suite("small_segment") {
- sql "set enable_common_expr_pushdown=true;"
+ sql "set enable_segment_limit_pushdown=true;"
// Test that ANN index is not built when segment size is smaller than required training rows
sql "drop table if exists tbl_small_segment"
diff --git a/regression-test/suites/backup_restore/test_backup_restore_inverted_idx.groovy b/regression-test/suites/backup_restore/test_backup_restore_inverted_idx.groovy
index 23afffe817e..0dd0914e84a 100644
--- a/regression-test/suites/backup_restore/test_backup_restore_inverted_idx.groovy
+++ b/regression-test/suites/backup_restore/test_backup_restore_inverted_idx.groovy
@@ -117,13 +117,13 @@ suite("test_backup_restore_inverted_idx", "backup_restore,nonConcurrent") {
// 1. query with inverted index
sql """ set enable_match_without_inverted_index = false """
- def res = sql """ SELECT /*+ SET_VAR(inverted_index_skip_threshold = 0, enable_common_expr_pushdown = true) */ * FROM ${dbName}.${tableName} WHERE value MATCH_ANY "10" """
+ def res = sql """ SELECT /*+ SET_VAR(inverted_index_skip_threshold = 0, enable_segment_limit_pushdown = true) */ * FROM ${dbName}.${tableName} WHERE value MATCH_ANY "10" """
assertTrue(res.size() > 0)
// 2. add partition and query
sql """ ALTER TABLE ${dbName}.${tableName} ADD PARTITION p8 VALUES LESS THAN ("80") """
sql """ INSERT INTO ${dbName}.${tableName} VALUES (75, "75 750", "76 77") """
- res = sql """ SELECT /*+ SET_VAR(inverted_index_skip_threshold = 0, enable_common_expr_pushdown = true) */ * FROM ${dbName}.${tableName} WHERE value MATCH_ANY "75" """
+ res = sql """ SELECT /*+ SET_VAR(inverted_index_skip_threshold = 0, enable_segment_limit_pushdown = true) */ * FROM ${dbName}.${tableName} WHERE value MATCH_ANY "75" """
assertTrue(res.size() > 0)
// 3. add new index
@@ -159,7 +159,7 @@ suite("test_backup_restore_inverted_idx", "backup_restore,nonConcurrent") {
logger.info("the build index status: ${build_status}")
assertTrue(false)
}
- res = sql """ SELECT /*+ SET_VAR(inverted_index_skip_threshold = 0, enable_common_expr_pushdown = true) */ * FROM ${dbName}.${tableName} WHERE value1 MATCH_ANY "12321" """
+ res = sql """ SELECT /*+ SET_VAR(inverted_index_skip_threshold = 0, enable_segment_limit_pushdown = true) */ * FROM ${dbName}.${tableName} WHERE value1 MATCH_ANY "12321" """
assertTrue(res.size() > 0)
} finally {
diff --git a/regression-test/suites/cloud_p0/cache/test_topn_broadcast.groovy b/regression-test/suites/cloud_p0/cache/test_topn_broadcast.groovy
index 340191423e3..02816e69f60 100644
--- a/regression-test/suites/cloud_p0/cache/test_topn_broadcast.groovy
+++ b/regression-test/suites/cloud_p0/cache/test_topn_broadcast.groovy
@@ -44,7 +44,7 @@ suite("test_topn_broadcast", "docker") {
def indexTbName = "test_topn_broadcast"
sql "set global enable_two_phase_read_opt = true"
- sql " set global enable_common_expr_pushdown = true "
+ sql " set global enable_segment_limit_pushdown = true "
sql " set global topn_opt_limit_threshold = 1024 "
sql "DROP TABLE IF EXISTS ${indexTbName}"
sql """
diff --git a/regression-test/suites/correctness/test_pushdown_common_expr.groovy b/regression-test/suites/correctness/test_pushdown_common_expr.groovy
index aa0e68e3e4c..e7af7658508 100644
--- a/regression-test/suites/correctness/test_pushdown_common_expr.groovy
+++ b/regression-test/suites/correctness/test_pushdown_common_expr.groovy
@@ -47,7 +47,7 @@ suite("test_pushdown_common_expr") {
"""
sql """set batch_size=8"""
- sql """set enable_common_expr_pushdown=true"""
+ sql """set enable_segment_limit_pushdown=true"""
order_qt_1 """
SELECT * FROM t_pushdown_common_expr WHERE c3 LIKE "%c%" OR c1 < 10;
@@ -103,7 +103,7 @@ suite("test_pushdown_common_expr") {
) AS t2 ON t1.c1 = t2.c1
"""
- sql """set enable_common_expr_pushdown=false"""
+ sql """set enable_segment_limit_pushdown = false"""
order_qt_1 """
SELECT * FROM t_pushdown_common_expr WHERE c3 LIKE "%h%" OR c1 < 10;
@@ -182,7 +182,7 @@ suite("test_pushdown_common_expr") {
(7,'g','gg','ggg','gggg','ggggg','gggggg');
"""
- sql """set enable_common_expr_pushdown=true"""
+ sql """set enable_segment_limit_pushdown=true"""
// delete condition columns num > block columns num
order_qt_1 """
diff --git a/regression-test/suites/datatype_p0/nested_types/query/test_nested_type_with_resize.groovy b/regression-test/suites/datatype_p0/nested_types/query/test_nested_type_with_resize.groovy
index 15cc424c3a6..66d0e36d857 100644
--- a/regression-test/suites/datatype_p0/nested_types/query/test_nested_type_with_resize.groovy
+++ b/regression-test/suites/datatype_p0/nested_types/query/test_nested_type_with_resize.groovy
@@ -64,9 +64,9 @@ suite("test_nested_type_with_resize") {
}
}
- order_qt_sql """ /*set ShuffleSendBytes=0|ShuffleSendRows=0|FuzzyVariables=batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=false,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=5,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=true,parallel_scan_max_scanners_count=48,parallel_scan_min_rows_per_scanner=16384,parallel_prepare_threshold=13,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_ [...]
- order_qt_sql """ /*set ShuffleSendBytes=0|ShuffleSendRows=0|FuzzyVariables=batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=false,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=5,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=true,parallel_scan_max_scanners_count=48,parallel_scan_min_rows_per_scanner=16384,parallel_prepare_threshold=13,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_ [...]
- order_qt_sql """ /*set ShuffleSendBytes=0|ShuffleSendRows=0|FuzzyVariables=batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=false,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=5,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=true,parallel_scan_max_scanners_count=48,parallel_scan_min_rows_per_scanner=16384,parallel_prepare_threshold=13,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_ [...]
- order_qt_sql """ /*set ShuffleSendBytes=0|ShuffleSendRows=0|FuzzyVariables=batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=false,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=5,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=true,parallel_scan_max_scanners_count=48,parallel_scan_min_rows_per_scanner=16384,parallel_prepare_threshold=13,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_ [...]
+ order_qt_sql """ /*set ShuffleSendBytes=0|ShuffleSendRows=0|FuzzyVariables=batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=false,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=5,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=true,parallel_scan_max_scanners_count=48,parallel_scan_min_rows_per_scanner=16384,parallel_prepare_threshold=13,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_ [...]
+ order_qt_sql """ /*set ShuffleSendBytes=0|ShuffleSendRows=0|FuzzyVariables=batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=false,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=5,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=true,parallel_scan_max_scanners_count=48,parallel_scan_min_rows_per_scanner=16384,parallel_prepare_threshold=13,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_ [...]
+ order_qt_sql """ /*set ShuffleSendBytes=0|ShuffleSendRows=0|FuzzyVariables=batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=false,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=5,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=true,parallel_scan_max_scanners_count=48,parallel_scan_min_rows_per_scanner=16384,parallel_prepare_threshold=13,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_ [...]
+ order_qt_sql """ /*set ShuffleSendBytes=0|ShuffleSendRows=0|FuzzyVariables=batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=false,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=5,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=true,parallel_scan_max_scanners_count=48,parallel_scan_min_rows_per_scanner=16384,parallel_prepare_threshold=13,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_ [...]
}
diff --git a/regression-test/suites/doc/sql-manual/basic-elements/data-types/array-md.groovy b/regression-test/suites/doc/sql-manual/basic-elements/data-types/array-md.groovy
index ee0fdcf38e6..231f483ff36 100644
--- a/regression-test/suites/doc/sql-manual/basic-elements/data-types/array-md.groovy
+++ b/regression-test/suites/doc/sql-manual/basic-elements/data-types/array-md.groovy
@@ -598,8 +598,8 @@ suite("array-md", "p0, nonConcurrent") {
GetDebugPoint().enableDebugPointForAllBEs(checkpoints_name, [filtered_rows: expectedFilteredRows])
sql "set experimental_enable_parallel_scan = false"
sql " set inverted_index_skip_threshold = 0 "
- sql " set enable_common_expr_pushdown_for_inverted_index = true"
- sql " set enable_common_expr_pushdown = true"
+ sql " set enable_segment_limit_pushdown = true"
+ sql " set enable_segment_limit_pushdown = true"
sql " set enable_parallel_scan = false"
sql "sync"
sql "${sqlQuery}"
diff --git a/regression-test/suites/fault_injection_p0/test_all_index_hit_fault_injection.groovy b/regression-test/suites/fault_injection_p0/test_all_index_hit_fault_injection.groovy
index eba1c5e93d2..9a4dd475c17 100644
--- a/regression-test/suites/fault_injection_p0/test_all_index_hit_fault_injection.groovy
+++ b/regression-test/suites/fault_injection_p0/test_all_index_hit_fault_injection.groovy
@@ -96,7 +96,7 @@ suite("test_all_index_hit_fault_injection", "nonConcurrent") {
load_httplogs_data.call(indexTbName2, 'test_all_index_hit_fault_injection_2', 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
try {
GetDebugPoint().enableDebugPointForAllBEs("segment_iterator._read_columns_by_index", [column_name: "clientip,request"])
GetDebugPoint().enableDebugPointForAllBEs("VectorizedFnCall.must_in_slow_path", [column_name: "status,size"])
diff --git a/regression-test/suites/fault_injection_p0/test_index_compaction_exception_fault_injection.groovy b/regression-test/suites/fault_injection_p0/test_index_compaction_exception_fault_injection.groovy
index 2351f087157..87e3e56c7a4 100644
--- a/regression-test/suites/fault_injection_p0/test_index_compaction_exception_fault_injection.groovy
+++ b/regression-test/suites/fault_injection_p0/test_index_compaction_exception_fault_injection.groovy
@@ -118,7 +118,7 @@ suite("test_index_compaction_exception_fault_injection", "nonConcurrent") {
}
def run_sql = { ->
- def result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_common_expr_pushdown = true) */ * FROM ${tableName} WHERE name MATCH 'bason'"
+ def result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_segment_limit_pushdown = true) */ * FROM ${tableName} WHERE name MATCH 'bason'"
assertEquals(3, result.size())
assertEquals(1, result[0]['id'])
assertEquals("bason", result[0]['name'])
@@ -127,7 +127,7 @@ suite("test_index_compaction_exception_fault_injection", "nonConcurrent") {
assertEquals(3, result[2]['id'])
assertEquals("bason", result[2]['name'])
- result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_common_expr_pushdown = true) */ * FROM ${tableName} WHERE age = 11"
+ result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_segment_limit_pushdown = true) */ * FROM ${tableName} WHERE age = 11"
assertEquals(3, result.size())
assertEquals(1, result[0]['id'])
assertEquals("bason", result[0]['name'])
@@ -136,7 +136,7 @@ suite("test_index_compaction_exception_fault_injection", "nonConcurrent") {
assertEquals(3, result[2]['id'])
assertEquals("bason", result[2]['name'])
- result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_common_expr_pushdown = true) */ * FROM ${tableName} WHERE description MATCH 'singing'"
+ result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_segment_limit_pushdown = true) */ * FROM ${tableName} WHERE description MATCH 'singing'"
assertEquals(3, result.size())
assertEquals("bason", result[0]['name'])
assertEquals("bason is good at singing", result[0]['description'])
@@ -145,7 +145,7 @@ suite("test_index_compaction_exception_fault_injection", "nonConcurrent") {
assertEquals("bason", result[2]['name'])
assertEquals("bason is good at singing", result[2]['description'])
- result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_common_expr_pushdown = true) */ * FROM ${tableName} WHERE array_contains(scores, 79)"
+ result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_segment_limit_pushdown = true) */ * FROM ${tableName} WHERE array_contains(scores, 79)"
assertEquals(3, result.size())
assertEquals("bason", result[0]['name'])
assertEquals("[79, 85, 97]", result[0]['scores'])
@@ -154,7 +154,7 @@ suite("test_index_compaction_exception_fault_injection", "nonConcurrent") {
assertEquals("bason", result[2]['name'])
assertEquals("[79, 85, 97]", result[2]['scores'])
- result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_common_expr_pushdown = true) */ * FROM ${tableName} WHERE array_contains(hobbies, 'dancing')"
+ result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_segment_limit_pushdown = true) */ * FROM ${tableName} WHERE array_contains(hobbies, 'dancing')"
assertEquals(3, result.size())
assertEquals("bason", result[0]['name'])
assertEquals('["singing", "dancing"]', result[0]['hobbies'])
@@ -163,7 +163,7 @@ suite("test_index_compaction_exception_fault_injection", "nonConcurrent") {
assertEquals("bason", result[2]['name'])
assertEquals('["singing", "dancing"]', result[2]['hobbies'])
- result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_common_expr_pushdown = true) */ * FROM ${tableName} WHERE array_contains(evaluation, 'bason is very clever')"
+ result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_segment_limit_pushdown = true) */ * FROM ${tableName} WHERE array_contains(evaluation, 'bason is very clever')"
assertEquals(3, result.size())
assertEquals("bason", result[0]['name'])
assertEquals('["bason is very clever", "bason is very healthy"]', result[0]['evaluation'])
diff --git a/regression-test/suites/fault_injection_p0/test_index_compound_file_fault_injection.groovy b/regression-test/suites/fault_injection_p0/test_index_compound_file_fault_injection.groovy
index e5e03d9e317..c1874e2f30a 100644
--- a/regression-test/suites/fault_injection_p0/test_index_compound_file_fault_injection.groovy
+++ b/regression-test/suites/fault_injection_p0/test_index_compound_file_fault_injection.groovy
@@ -74,7 +74,7 @@ suite("test_index_compound_file_fault_injection", "nonConcurrent") {
load_httplogs_data.call(indexTbName, 'test_index_compound_file_fault_injection', 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
try {
GetDebugPoint().enableDebugPointForAllBEs("CSIndexInput.readInternal")
diff --git a/regression-test/suites/fault_injection_p0/test_index_empty_segment_fault_injection.groovy b/regression-test/suites/fault_injection_p0/test_index_empty_segment_fault_injection.groovy
index ad50e17f7f7..7246cde2a34 100644
--- a/regression-test/suites/fault_injection_p0/test_index_empty_segment_fault_injection.groovy
+++ b/regression-test/suites/fault_injection_p0/test_index_empty_segment_fault_injection.groovy
@@ -47,7 +47,7 @@ suite("test_index_empty_segment_fault_injection", "nonConcurrent") {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
sql """ set enable_match_without_inverted_index = false; """
try {
diff --git a/regression-test/suites/fault_injection_p0/test_index_file_cache_fault_injection.groovy b/regression-test/suites/fault_injection_p0/test_index_file_cache_fault_injection.groovy
index 8a04c15b839..fa7341a4342 100644
--- a/regression-test/suites/fault_injection_p0/test_index_file_cache_fault_injection.groovy
+++ b/regression-test/suites/fault_injection_p0/test_index_file_cache_fault_injection.groovy
@@ -72,7 +72,7 @@ suite("test_index_file_cache_fault_injection", "nonConcurrent") {
load_httplogs_data.call(indexTbName, 'test_index_file_cache_fault_injection', 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
try {
GetDebugPoint().enableDebugPointForAllBEs("CSIndexInput.readInternal")
diff --git a/regression-test/suites/fault_injection_p0/test_index_inlist_fault_injection.groovy b/regression-test/suites/fault_injection_p0/test_index_inlist_fault_injection.groovy
index 54852394601..f08dffb36b2 100644
--- a/regression-test/suites/fault_injection_p0/test_index_inlist_fault_injection.groovy
+++ b/regression-test/suites/fault_injection_p0/test_index_inlist_fault_injection.groovy
@@ -76,7 +76,7 @@ suite("test_index_inlist_fault_injection", "nonConcurrent") {
sql "sync"
try {
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_sql """ select /*+ SET_VAR(inverted_index_skip_threshold = 0) */ count() from ${indexTbName} where clientip in ('40.135.0.0', '232.0.0.0', '26.1.0.0'); """
qt_sql """ select /*+ SET_VAR(inverted_index_skip_threshold = 0) */ count() from ${indexTbName} where status in (1, 304, 200); """
@@ -89,7 +89,7 @@ suite("test_index_inlist_fault_injection", "nonConcurrent") {
}
try {
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_sql """ select count() from ${indexTbName} where (clientip in ('40.135.0.0', '232.0.0.0', NULL, '26.1.0.0', '247.37.0.0')); """
qt_sql """ select count() from ${indexTbName} where (clientip not in ('40.135.0.0', '232.0.0.0', NULL, '26.1.0.0', '247.37.0.0')); """
@@ -101,7 +101,7 @@ suite("test_index_inlist_fault_injection", "nonConcurrent") {
qt_sql """ select count() from ${indexTbName} where (clientip = '2.1.0.0' and clientip = NULL or clientip = '40.135.0.0'); """
qt_sql """ select count() from ${indexTbName} where (clientip = '2.1.0.0' or clientip = NULL and clientip = '40.135.0.0'); """
- sql """ set enable_common_expr_pushdown = false; """
+ sql """ set enable_segment_limit_pushdown = false; """
qt_sql """ select count() from ${indexTbName} where (clientip in ('40.135.0.0', '232.0.0.0', NULL, '26.1.0.0', '247.37.0.0')); """
qt_sql """ select count() from ${indexTbName} where (clientip not in ('40.135.0.0', '232.0.0.0', NULL, '26.1.0.0', '247.37.0.0')); """
@@ -113,7 +113,7 @@ suite("test_index_inlist_fault_injection", "nonConcurrent") {
qt_sql """ select count() from ${indexTbName} where (clientip = '2.1.0.0' and clientip = NULL or clientip = '40.135.0.0'); """
qt_sql """ select count() from ${indexTbName} where (clientip = '2.1.0.0' or clientip = NULL and clientip = '40.135.0.0'); """
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
sql """ set in_list_value_count_threshold = 0; """
qt_sql """ select count() from ${indexTbName} where (clientip in ('40.135.0.0', '232.0.0.0', '26.1.0.0', '247.37.0.0') or status = 200); """
diff --git a/regression-test/suites/fault_injection_p0/test_index_mow_fault_injection.groovy b/regression-test/suites/fault_injection_p0/test_index_mow_fault_injection.groovy
index a0559119d2a..862d9bbab9b 100644
--- a/regression-test/suites/fault_injection_p0/test_index_mow_fault_injection.groovy
+++ b/regression-test/suites/fault_injection_p0/test_index_mow_fault_injection.groovy
@@ -47,7 +47,7 @@ suite("test_index_mow_fault_injection", "nonConcurrent") {
try {
sql "DROP TABLE IF EXISTS ${testTable_unique}"
create_httplogs_unique_table.call(testTable_unique)
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ INSERT INTO ${testTable_unique} VALUES (893964617, '40.135.0.0', 'GET /images/hm_bg.jpg HTTP/1.0', 200, 24736); """
sql """ INSERT INTO ${testTable_unique} VALUES (893964653, '232.0.0.0', 'GET /images/hm_bg.jpg HTTP/1.0', 200, 3781); """
diff --git a/regression-test/suites/fault_injection_p0/test_match_without_index_fault_injection.groovy b/regression-test/suites/fault_injection_p0/test_match_without_index_fault_injection.groovy
index db03b75bee6..cbdc88ad272 100644
--- a/regression-test/suites/fault_injection_p0/test_match_without_index_fault_injection.groovy
+++ b/regression-test/suites/fault_injection_p0/test_match_without_index_fault_injection.groovy
@@ -39,7 +39,7 @@ suite("test_match_without_index_fault_injection", "nonConcurrent") {
"replication_allocation" = "tag.location.default: 1"
);
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ INSERT INTO ${testTable} VALUES (123, '17.0.0.0', 'HTTP GET', '200', 20); """
sql """ INSERT INTO ${testTable} VALUES (123, '17.0.0.0', 'Life is like a box of chocolates, you never know what you are going to get.', '200', 20); """
diff --git a/regression-test/suites/fault_injection_p0/test_need_read_data_fault_injection.groovy b/regression-test/suites/fault_injection_p0/test_need_read_data_fault_injection.groovy
index 4e0b633ddb8..0d135653e91 100644
--- a/regression-test/suites/fault_injection_p0/test_need_read_data_fault_injection.groovy
+++ b/regression-test/suites/fault_injection_p0/test_need_read_data_fault_injection.groovy
@@ -73,7 +73,7 @@ suite("test_need_read_data_fault_injection", "nonConcurrent") {
load_httplogs_data.call(indexTbName, 'test_need_read_data_fault_injection', 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
try {
GetDebugPoint().enableDebugPointForAllBEs("segment_iterator._read_columns_by_index")
diff --git a/regression-test/suites/fault_injection_p0/test_variant_count_on_index_fault_injection.groovy b/regression-test/suites/fault_injection_p0/test_variant_count_on_index_fault_injection.groovy
index de4be5566d1..c19d39cb741 100644
--- a/regression-test/suites/fault_injection_p0/test_variant_count_on_index_fault_injection.groovy
+++ b/regression-test/suites/fault_injection_p0/test_variant_count_on_index_fault_injection.groovy
@@ -23,7 +23,7 @@ suite("test_variant_count_on_index_fault_injection", "p0, nonConcurrent") {
sql "DROP TABLE IF EXISTS ${tbl}"
- sql "set enable_common_expr_pushdown = true"
+ sql "set enable_segment_limit_pushdown = true"
sql "set enable_count_on_index_pushdown = true"
sql "set enable_match_without_inverted_index = false"
sql "set experimental_enable_nereids_planner = true"
diff --git a/regression-test/suites/fault_injection_p0/test_write_inverted_index_exception_fault_injection.groovy b/regression-test/suites/fault_injection_p0/test_write_inverted_index_exception_fault_injection.groovy
index d33d33c1222..cb2dff95a30 100644
--- a/regression-test/suites/fault_injection_p0/test_write_inverted_index_exception_fault_injection.groovy
+++ b/regression-test/suites/fault_injection_p0/test_write_inverted_index_exception_fault_injection.groovy
@@ -100,7 +100,7 @@ suite("test_write_inverted_index_exception_fault_injection", "nonConcurrent") {
}
def run_select = { String tableName, boolean normal ->
- def result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_common_expr_pushdown = true) */ * FROM ${tableName} WHERE name MATCH 'andy'"
+ def result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_segment_limit_pushdown = true) */ * FROM ${tableName} WHERE name MATCH 'andy'"
assertEquals(3, result.size())
assertEquals(1, result[0]['id'])
assertEquals("andy", result[0]['name'])
@@ -109,7 +109,7 @@ suite("test_write_inverted_index_exception_fault_injection", "nonConcurrent") {
assertEquals(3, result[2]['id'])
assertEquals("andy", result[2]['name'])
- result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_common_expr_pushdown = true) */ * FROM ${tableName} WHERE age < 11"
+ result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_segment_limit_pushdown = true) */ * FROM ${tableName} WHERE age < 11"
assertEquals(3, result.size())
assertEquals("andy", result[0]['name'])
assertEquals(2, result[1]['id'])
@@ -117,7 +117,7 @@ suite("test_write_inverted_index_exception_fault_injection", "nonConcurrent") {
assertEquals(3, result[2]['id'])
assertEquals("andy", result[2]['name'])
- result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_common_expr_pushdown = true) */ * FROM ${tableName} WHERE description MATCH 'sports'"
+ result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_segment_limit_pushdown = true) */ * FROM ${tableName} WHERE description MATCH 'sports'"
assertEquals(3, result.size())
assertEquals("andy", result[0]['name'])
assertEquals("andy is good at sports", result[0]['description'])
@@ -127,7 +127,7 @@ suite("test_write_inverted_index_exception_fault_injection", "nonConcurrent") {
assertEquals("andy is good at sports", result[2]['description'])
if (normal) {
- result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_common_expr_pushdown = true) */ * FROM ${tableName} WHERE array_contains(scores, 79)"
+ result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_segment_limit_pushdown = true) */ * FROM ${tableName} WHERE array_contains(scores, 79)"
assertEquals(3, result.size())
assertEquals("bason", result[0]['name'])
assertEquals("[79, 85, 97]", result[0]['scores'])
@@ -136,10 +136,10 @@ suite("test_write_inverted_index_exception_fault_injection", "nonConcurrent") {
assertEquals("bason", result[2]['name'])
assertEquals("[79, 85, 97]", result[2]['scores'])
} else {
- result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_common_expr_pushdown = true) */ * FROM ${tableName} WHERE array_contains(scores, 79)"
+ result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_segment_limit_pushdown = true) */ * FROM ${tableName} WHERE array_contains(scores, 79)"
assertEquals(0, result.size())
}
- result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_common_expr_pushdown = true) */ * FROM ${tableName} WHERE array_contains(hobbies, 'football')"
+ result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_segment_limit_pushdown = true) */ * FROM ${tableName} WHERE array_contains(hobbies, 'football')"
assertEquals(3, result.size())
assertEquals("andy", result[0]['name'])
assertEquals('["football", "basketball"]', result[0]['hobbies'])
@@ -148,7 +148,7 @@ suite("test_write_inverted_index_exception_fault_injection", "nonConcurrent") {
assertEquals("andy", result[2]['name'])
assertEquals('["football", "basketball"]', result[2]['hobbies'])
- result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_common_expr_pushdown = true) */ * FROM ${tableName} WHERE array_contains(evaluation, 'andy is so nice')"
+ result = sql_return_maparray "SELECT /*+ SET_VAR(enable_match_without_inverted_index = false, enable_segment_limit_pushdown = true) */ * FROM ${tableName} WHERE array_contains(evaluation, 'andy is so nice')"
assertEquals(3, result.size())
assertEquals("andy", result[0]['name'])
assertEquals('["andy has a good heart", "andy is so nice"]', result[0]['evaluation'])
diff --git a/regression-test/suites/inverted_index_p0/analyzer/test_basic_analyzer.groovy b/regression-test/suites/inverted_index_p0/analyzer/test_basic_analyzer.groovy
index 863c3ddba63..3269b24dfa3 100644
--- a/regression-test/suites/inverted_index_p0/analyzer/test_basic_analyzer.groovy
+++ b/regression-test/suites/inverted_index_p0/analyzer/test_basic_analyzer.groovy
@@ -41,7 +41,7 @@ suite("test_basic_analyzer", "p0"){
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_sql """ select * from ${indexTbName1} where b match_phrase 'images hm_bg.jpg'; """
qt_sql """ select * from ${indexTbName1} where b match_phrase 'อย ใน'; """
diff --git a/regression-test/suites/inverted_index_p0/analyzer/test_builtin_analyzer_in_custom_analyzer.groovy b/regression-test/suites/inverted_index_p0/analyzer/test_builtin_analyzer_in_custom_analyzer.groovy
index 25e9cda1a40..d62594b7ea0 100644
--- a/regression-test/suites/inverted_index_p0/analyzer/test_builtin_analyzer_in_custom_analyzer.groovy
+++ b/regression-test/suites/inverted_index_p0/analyzer/test_builtin_analyzer_in_custom_analyzer.groovy
@@ -93,7 +93,7 @@ suite("test_builtin_analyzer_in_custom_analyzer", "p0") {
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// Test MATCH queries with analyzer_with_standard
qt_sql_basic_match_logo """ SELECT * FROM ${indexTblName} WHERE url MATCH 'logo' ORDER BY id; """
@@ -128,7 +128,7 @@ suite("test_builtin_analyzer_in_custom_analyzer", "p0") {
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// Test basic analyzer on URL-like strings
qt_sql_basic_match_logo """ SELECT * FROM ${indexTblName2} WHERE url MATCH 'logo' ORDER BY id; """
diff --git a/regression-test/suites/inverted_index_p0/analyzer/test_char_group_tokenizer.groovy b/regression-test/suites/inverted_index_p0/analyzer/test_char_group_tokenizer.groovy
index d65bc7d9781..7ba03043391 100644
--- a/regression-test/suites/inverted_index_p0/analyzer/test_char_group_tokenizer.groovy
+++ b/regression-test/suites/inverted_index_p0/analyzer/test_char_group_tokenizer.groovy
@@ -131,7 +131,7 @@ suite("test_char_group_tokenizer", "p0") {
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// Match queries leveraging the analyzer
qt_sql """ select id, ch from ${tbl} where ch match 'World'; """
diff --git a/regression-test/suites/inverted_index_p0/analyzer/test_custom_analyzer.groovy b/regression-test/suites/inverted_index_p0/analyzer/test_custom_analyzer.groovy
index 0610fc366bf..4d34b6fe902 100644
--- a/regression-test/suites/inverted_index_p0/analyzer/test_custom_analyzer.groovy
+++ b/regression-test/suites/inverted_index_p0/analyzer/test_custom_analyzer.groovy
@@ -382,7 +382,7 @@ suite("test_custom_analyzer", "p0") {
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_sql """ select * from ${indexTbName1} where ch match 'abcDEF'; """
qt_sql """ select * from ${indexTbName1} where ch match '中'; """
@@ -407,7 +407,7 @@ suite("test_custom_analyzer", "p0") {
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_sql """ select * from ${indexTbName2} where ch match '102'; """
} finally {
@@ -531,7 +531,7 @@ suite("test_custom_analyzer", "p0") {
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// Test full pinyin
qt_sql_pinyin1 """ select * from ${indexTbName4} where name match 'liudehua' order by a; """
@@ -597,7 +597,7 @@ suite("test_custom_analyzer", "p0") {
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// Test joined full pinyin
qt_sql_pinyin_joined1 """ select * from ${indexTbName5} where name match 'liudehua' order by a; """
@@ -643,7 +643,7 @@ suite("test_custom_analyzer", "p0") {
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// Standard tokenizer splits by space, then applies pinyin filter
qt_sql_standard_pinyin1 """ select * from ${indexTbName6} where content match 'l' order by a; """
@@ -872,7 +872,7 @@ suite("test_custom_analyzer", "p0") {
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// Test queries with ignore_pinyin_offset=true
qt_sql_table_ignore_offset_1 """ select * from ${indexTbName7} where content match 'liu' order by a; """
diff --git a/regression-test/suites/inverted_index_p0/analyzer/test_custom_analyzer1.groovy b/regression-test/suites/inverted_index_p0/analyzer/test_custom_analyzer1.groovy
index 665cda3b346..83d51ad7831 100644
--- a/regression-test/suites/inverted_index_p0/analyzer/test_custom_analyzer1.groovy
+++ b/regression-test/suites/inverted_index_p0/analyzer/test_custom_analyzer1.groovy
@@ -105,7 +105,7 @@ suite("test_custom_analyzer1", "p0") {
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_sql """ select * from test_custom_analyzer1 where ch match 'with'; """
qt_sql """ select * from test_custom_analyzer1 where ch match 'the'; """
diff --git a/regression-test/suites/inverted_index_p0/analyzer/test_custom_analyzer2.groovy b/regression-test/suites/inverted_index_p0/analyzer/test_custom_analyzer2.groovy
index 88fa81a3efc..797e5141d56 100644
--- a/regression-test/suites/inverted_index_p0/analyzer/test_custom_analyzer2.groovy
+++ b/regression-test/suites/inverted_index_p0/analyzer/test_custom_analyzer2.groovy
@@ -51,7 +51,7 @@ suite("test_custom_analyzer2", "p0") {
sql """ insert into test_custom_analyzer2_1 values(2, "美国人民"); """
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_sql """ select count(1) from test_custom_analyzer2_1 where ch match '中'; """
qt_sql """ select count(1) from test_custom_analyzer2_1 where ch match '国'; """
diff --git a/regression-test/suites/inverted_index_p0/analyzer/test_custom_normalizer.groovy b/regression-test/suites/inverted_index_p0/analyzer/test_custom_normalizer.groovy
index bac9b0ff4d8..fefa0c9bfca 100644
--- a/regression-test/suites/inverted_index_p0/analyzer/test_custom_normalizer.groovy
+++ b/regression-test/suites/inverted_index_p0/analyzer/test_custom_normalizer.groovy
@@ -100,7 +100,7 @@ suite("test_custom_normalizer", "p0") {
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_sql_match_cafe """
SELECT id, content
diff --git a/regression-test/suites/inverted_index_p0/analyzer/test_icu_analyzer.groovy b/regression-test/suites/inverted_index_p0/analyzer/test_icu_analyzer.groovy
index 2fa943b9ca9..4b596ad0685 100644
--- a/regression-test/suites/inverted_index_p0/analyzer/test_icu_analyzer.groovy
+++ b/regression-test/suites/inverted_index_p0/analyzer/test_icu_analyzer.groovy
@@ -41,7 +41,7 @@ suite("test_icu_analyzer", "p0"){
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_sql """ select * from ${indexTbName1} where b match_phrase 'images hm_bg.jpg'; """
qt_sql """ select * from ${indexTbName1} where b match_phrase 'อย ใน'; """
diff --git a/regression-test/suites/inverted_index_p0/analyzer/test_ik_analyzer.groovy b/regression-test/suites/inverted_index_p0/analyzer/test_ik_analyzer.groovy
index b57d40a4a00..e806a339fb0 100644
--- a/regression-test/suites/inverted_index_p0/analyzer/test_ik_analyzer.groovy
+++ b/regression-test/suites/inverted_index_p0/analyzer/test_ik_analyzer.groovy
@@ -66,7 +66,7 @@ suite("test_ik_analyzer", "p0") {
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// Testing ik smart mode
println "Testing ik smart mode:"
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_add_drop_index_with_data_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_add_drop_index_with_data_arr.groovy
index 326bb3d9ab0..feb2895cf9d 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_add_drop_index_with_data_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_add_drop_index_with_data_arr.groovy
@@ -26,8 +26,7 @@ suite("test_add_drop_index_with_data_arr", "array_contains_inverted_index") {
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def wait_for_latest_op_on_table_finish = { table_name, OpTimeout ->
for(int t = delta_time; t <= OpTimeout; t += delta_time){
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_add_drop_index_with_delete_data_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_add_drop_index_with_delete_data_arr.groovy
index 717d0e93d63..59acd97093b 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_add_drop_index_with_delete_data_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_add_drop_index_with_delete_data_arr.groovy
@@ -26,8 +26,7 @@ suite("test_add_drop_index_with_delete_data_arr", "array_contains_inverted_index
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def wait_for_latest_op_on_table_finish = { table_name, OpTimeout ->
for(int t = delta_time; t <= OpTimeout; t += delta_time){
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_add_index_for_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_add_index_for_arr.groovy
index 78bec2d11b0..db5ea1ec172 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_add_index_for_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_add_index_for_arr.groovy
@@ -26,7 +26,7 @@ suite("test_add_index_for_arr") {
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=false"""
- sql """ set enable_common_expr_pushdown=true """
+ sql """ set enable_segment_limit_pushdown=true """
def wait_for_latest_op_on_table_finish = { table_name, OpTimeout ->
for(int t = delta_time; t <= OpTimeout; t += delta_time){
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_array_contains_estimate.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_array_contains_estimate.groovy
index c1d98f80c11..643774e4d11 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_array_contains_estimate.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_array_contains_estimate.groovy
@@ -20,7 +20,7 @@ suite("test_array_contains_estimate", "nonConcurrent"){
def indexTblName = "tai_estimate"
def dataFile = "tai_estimate.csv"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
sql """ set enable_profile = true;"""
sql """ set enable_inverted_index_query=true; """
sql """ set inverted_index_skip_threshold = 0; """ // set skip threshold to 0
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_char_replace_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_char_replace_arr.groovy
index 8a80b1b1fe4..f87e4e7a9be 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_char_replace_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_char_replace_arr.groovy
@@ -23,8 +23,7 @@ suite("test_char_replace_array_contains_arr", "array_contains_inverted_index") {
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
sql "DROP TABLE IF EXISTS ${indexTblName}"
// create 1 replica table
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_compound_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_compound_arr.groovy
index e4acc0b56f9..c95c170609f 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_compound_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_compound_arr.groovy
@@ -25,8 +25,7 @@ suite("test_compound_arr", "array_contains_inverted_index"){
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def indexTblName = "test_compound_arr"
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_count_on_index_httplogs_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_count_on_index_httplogs_arr.groovy
index 3466833231d..abcb8d8d541 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_count_on_index_httplogs_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_count_on_index_httplogs_arr.groovy
@@ -24,8 +24,7 @@ suite("test_count_on_index_httplogs_arr", "array_contains_inverted_index") {
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def create_httplogs_dup_table = {testTablex ->
// multi-line sql
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_equal_on_fulltext_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_equal_on_fulltext_arr.groovy
index b36b82a41f1..e93847ce806 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_equal_on_fulltext_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_equal_on_fulltext_arr.groovy
@@ -22,8 +22,7 @@ suite("test_equal_on_fulltext_arr", "array_contains_inverted_index"){
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def indexTblName = "test_equal_on_fulltext_arr"
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_index_bkd_null_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_index_bkd_null_arr.groovy
index 973c42f8e3e..c15d0e269e0 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_index_bkd_null_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_index_bkd_null_arr.groovy
@@ -22,8 +22,7 @@ suite("test_bkd_null_index_arr", "array_contains_inverted_index"){
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def indexTblName = "bkd_null_index_test_arr"
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_index_change_2_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_index_change_2_arr.groovy
index de1ee5b86c0..3ba4760edb0 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_index_change_2_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_index_change_2_arr.groovy
@@ -27,8 +27,7 @@ suite("test_index_change_2_arr", "array_contains_inverted_index") {
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def wait_for_latest_op_on_table_finish = { table_name, OpTimeout ->
for(int t = delta_time; t <= OpTimeout; t += delta_time){
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_index_change_4_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_index_change_4_arr.groovy
index e4ae587cf9d..740316e011a 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_index_change_4_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_index_change_4_arr.groovy
@@ -27,8 +27,7 @@ suite("test_index_change_4_arr", "array_contains_inverted_index") {
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def wait_for_latest_op_on_table_finish = { table_name, OpTimeout ->
for(int t = delta_time; t <= OpTimeout; t += delta_time){
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_index_change_6_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_index_change_6_arr.groovy
index 3010a7cb99a..95cf8c8ced6 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_index_change_6_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_index_change_6_arr.groovy
@@ -26,8 +26,7 @@ suite("test_index_change_6_arr", "array_contains_inverted_index") {
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def wait_for_latest_op_on_table_finish = { table_name, OpTimeout ->
for(int t = delta_time; t <= OpTimeout; t += delta_time){
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_dup_keys_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_dup_keys_arr.groovy
index c7d41e68cdd..94007c75825 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_dup_keys_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_dup_keys_arr.groovy
@@ -22,8 +22,7 @@ suite("test_index_compaction_dup_keys_array", "array_contains_inverted_index, no
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def isCloudMode = isCloudMode()
def tableName = "test_index_compaction_dup_keys_array"
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_null_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_null_arr.groovy
index dfc38998c4d..47bc3db051c 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_null_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_null_arr.groovy
@@ -22,8 +22,7 @@ suite("test_index_compaction_null_arr", "array_contains_inverted_index, nonConcu
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def isCloudMode = isCloudMode()
def tableName = "test_index_compaction_null_dups_arr"
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_unique_keys_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_unique_keys_arr.groovy
index 6de254c699a..ae6a0705c5a 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_unique_keys_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_unique_keys_arr.groovy
@@ -22,8 +22,7 @@ suite("test_index_compaction_unique_keys_arr", "array_contains_inverted_index, n
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def isCloudMode = isCloudMode()
def tableName = "test_index_compaction_unique_keys_arr"
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_with_multi_index_segments_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_with_multi_index_segments_arr.groovy
index 3ef2dcf5dc1..99c73066228 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_with_multi_index_segments_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_index_compaction_with_multi_index_segments_arr.groovy
@@ -22,8 +22,7 @@ suite("test_index_compaction_with_multi_index_segments_arr", "nonConcurrent") {
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def isCloudMode = isCloudMode()
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_index_delete_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_index_delete_arr.groovy
index b243dd0379c..0f8427c3124 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_index_delete_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_index_delete_arr.groovy
@@ -21,8 +21,7 @@ suite("test_index_delete_arr", "array_contains_inverted_index") {
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def indexTbName1 = "test_index_delete_arr"
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_index_empty_string_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_index_empty_string_arr.groovy
index aae16716f94..69204c88ebe 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_index_empty_string_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_index_empty_string_arr.groovy
@@ -25,8 +25,7 @@ suite("test_index_empty_string_arr", "array_contains_inverted_index"){
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def indexTblName = "test_index_empty_string_arr"
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_index_equal_select_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_index_equal_select_arr.groovy
index 3542fc8f665..fb0d7667f44 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_index_equal_select_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_index_equal_select_arr.groovy
@@ -20,8 +20,7 @@ suite("test_index_equal_select_arr", "array_contains_inverted_index"){
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def indexTbName1 = "index_equal_select_arr"
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_index_match_phrase_edge_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_index_match_phrase_edge_arr.groovy
index 2c9627cef07..85a613f2e5f 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_index_match_phrase_edge_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_index_match_phrase_edge_arr.groovy
@@ -21,8 +21,7 @@ suite("test_index_match_phrase_edge_arr", "array_contains_inverted_index"){
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def indexTbName1 = "test_index_match_phrase_edge_arr"
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_index_match_regexp_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_index_match_regexp_arr.groovy
index 009299e4994..d3b824de5cd 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_index_match_regexp_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_index_match_regexp_arr.groovy
@@ -21,8 +21,7 @@ suite("test_index_match_regexp_arr", "array_contains_inverted_index"){
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def indexTbName1 = "test_index_match_regexp_arr"
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_index_null_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_index_null_arr.groovy
index ab68b5650e1..79ef937173b 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_index_null_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_index_null_arr.groovy
@@ -21,8 +21,7 @@ suite("test_null_index_arr", "array_contains_inverted_index"){
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
// prepare test table
def timeout = 60000
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_invalid_param.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_invalid_param.groovy
index eb4b1c1fdef..9f20dad5b45 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_invalid_param.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_invalid_param.groovy
@@ -21,8 +21,7 @@ suite("test_invalid_param", "array_contains_inverted_index"){
def indexTblName = "unicode_test1_arr"
sql """ set enable_profile = true; """
sql """ set enable_inverted_index_query=true; """
- sql """ set enable_common_expr_pushdown=true; """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true; """
+ sql """ set enable_segment_limit_pushdown=true; """
sql "DROP TABLE IF EXISTS ${indexTblName}"
sql """
CREATE TABLE IF NOT EXISTS ${indexTblName}(
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_inverted_index_null_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_inverted_index_null_arr.groovy
index 3b231a424c4..b274c115bf8 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_inverted_index_null_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_inverted_index_null_arr.groovy
@@ -20,8 +20,7 @@ suite("test_inverted_index_null_arr", "array_contains_inverted_index") {
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
def tableName = "test_inverted_index_null_arr"
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_lowercase_arr.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_lowercase_arr.groovy
index 7ffd0fcc1e5..d3130f50130 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_lowercase_arr.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_lowercase_arr.groovy
@@ -21,8 +21,7 @@ suite("test_lowercase_arr", "array_contains_inverted_index"){
sql """ set enable_profile=true"""
sql """ set enable_pipeline_x_engine=true;"""
sql """ set enable_inverted_index_query=true"""
- sql """ set enable_common_expr_pushdown=true """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true """
+ sql """ set enable_segment_limit_pushdown=true """
// prepare test table
def indexTblName = "lowercase_test1_arr"
diff --git a/regression-test/suites/inverted_index_p0/array_contains/test_parser_with_none_stopwords.groovy b/regression-test/suites/inverted_index_p0/array_contains/test_parser_with_none_stopwords.groovy
index 28a7555b01d..8c938fe9f44 100644
--- a/regression-test/suites/inverted_index_p0/array_contains/test_parser_with_none_stopwords.groovy
+++ b/regression-test/suites/inverted_index_p0/array_contains/test_parser_with_none_stopwords.groovy
@@ -21,8 +21,7 @@ suite("test_parser_with_none_stopwords", "array_contains_inverted_index"){
def indexTblName = "unicode_test1_arr_no_stopwords"
sql """ set enable_profile = true; """
sql """ set enable_inverted_index_query=true; """
- sql """ set enable_common_expr_pushdown=true; """
- sql """ set enable_common_expr_pushdown_for_inverted_index=true; """
+ sql """ set enable_segment_limit_pushdown=true; """
sql "DROP TABLE IF EXISTS ${indexTblName}"
sql """
CREATE TABLE IF NOT EXISTS ${indexTblName}(
diff --git a/regression-test/suites/inverted_index_p0/char_filter/test_char_replace.groovy b/regression-test/suites/inverted_index_p0/char_filter/test_char_replace.groovy
index 192c123aead..144ea5aebc6 100644
--- a/regression-test/suites/inverted_index_p0/char_filter/test_char_replace.groovy
+++ b/regression-test/suites/inverted_index_p0/char_filter/test_char_replace.groovy
@@ -45,7 +45,7 @@ suite("test_char_replace") {
"replication_allocation" = "tag.location.default: 1"
);
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
def var_result = sql "show variables"
logger.info("show variales result: " + var_result )
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 b8dc5db6ec5..f224660a3e2 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,8 +18,7 @@
// 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"
+ sql "SET enable_segment_limit_pushdown=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 1aee562d70f..4268c91e38a 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,8 +28,7 @@ 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"
+ sql "SET enable_segment_limit_pushdown=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 59ce906ddfd..1c2b413f4c6 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,8 +20,7 @@ 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"
+ sql "SET enable_segment_limit_pushdown=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 23918556be6..c6e7143a7d7 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,8 +16,7 @@
// 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 "SET enable_segment_limit_pushdown=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 f254b843dea..215b3b83a4a 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,8 +16,7 @@
// 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_segment_limit_pushdown=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 469638a4b3e..9930fe6ab33 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,8 +22,7 @@ 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"
+ sql "SET enable_segment_limit_pushdown=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 54cf16e66ea..bca68a01fef 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,8 +22,7 @@ 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"
+ sql "SET enable_segment_limit_pushdown=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 a16db778a9b..c6c5826f004 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,8 +22,7 @@ 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"
+ sql "SET enable_segment_limit_pushdown=true"
def waitAnalyzerInstalled = { String name ->
def deadline = System.currentTimeMillis() + 180_000
Exception lastNotFound = null
diff --git a/regression-test/suites/inverted_index_p0/index_change/test_build_index_multi_analyzer_order.groovy b/regression-test/suites/inverted_index_p0/index_change/test_build_index_multi_analyzer_order.groovy
index 72df30031e3..55b81ac249c 100644
--- a/regression-test/suites/inverted_index_p0/index_change/test_build_index_multi_analyzer_order.groovy
+++ b/regression-test/suites/inverted_index_p0/index_change/test_build_index_multi_analyzer_order.groovy
@@ -167,7 +167,7 @@ suite("test_build_index_multi_analyzer_order") {
sql "sync"
// Pin fuzzy variable: search() requires common expr pushdown to work
- sql "SET enable_common_expr_pushdown = true"
+ sql "SET enable_segment_limit_pushdown = true"
// === Verification: regex /\d\d\d\d/ should match exactly 4-digit tokens ===
// With edge_ngram analyzer, "11921" produces tokens: "119", "1192", "11921"
diff --git a/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_dup_keys.groovy b/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_dup_keys.groovy
index 4becf9b5183..eddec60c196 100644
--- a/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_dup_keys.groovy
+++ b/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_dup_keys.groovy
@@ -114,7 +114,7 @@ suite("test_index_compaction_dup_keys", "nonConcurrent") {
sql """ INSERT INTO ${tableName} VALUES (2, "bason", "bason hate pear", 99); """
sql """ INSERT INTO ${tableName} VALUES (3, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (3, "bason", "bason hate pear", 99); """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql """ select * from ${tableName} order by id, name, hobbies, score """
qt_sql """ select * from ${tableName} where name match "andy" order by id, name, hobbies, score """
diff --git a/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_null.groovy b/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_null.groovy
index 0538ce7e83e..b02dcd008ee 100644
--- a/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_null.groovy
+++ b/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_null.groovy
@@ -120,7 +120,7 @@ suite("test_index_compaction_null", "nonConcurrent") {
}
def run_sql = { ->
- sql """ set enable_common_expr_pushdown=true """
+ sql """ set enable_segment_limit_pushdown=true """
// select all data
qt_select_0 "SELECT * FROM ${tableName} ORDER BY id"
@@ -310,7 +310,7 @@ suite("test_index_compaction_null", "nonConcurrent") {
"inverted_index_storage_format" = "V2"
)
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
tablets = sql_return_maparray """ show tablets from ${tableName}; """
run_test.call(tablets)
diff --git a/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_unique_keys.groovy b/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_unique_keys.groovy
index 94b79a281fb..d4476af58fc 100644
--- a/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_unique_keys.groovy
+++ b/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_unique_keys.groovy
@@ -112,7 +112,7 @@ suite("test_index_compaction_unique_keys", "nonConcurrent") {
"inverted_index_storage_format" = "V2"
);
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ INSERT INTO ${tableName} VALUES (1, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (1, "bason", "bason hate pear", 99); """
diff --git a/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_with_multi_index_segments.groovy b/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_with_multi_index_segments.groovy
index 3b66474dbaf..3aa089840eb 100644
--- a/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_with_multi_index_segments.groovy
+++ b/regression-test/suites/inverted_index_p0/index_compaction/test_index_compaction_with_multi_index_segments.groovy
@@ -94,7 +94,7 @@ suite("test_index_compaction_with_multi_index_segments", "nonConcurrent") {
// check config
check_config.call("inverted_index_compaction_enable", "true")
check_config.call("inverted_index_max_buffered_docs", "5")
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
/**
* test duplicated tables
diff --git a/regression-test/suites/inverted_index_p0/index_format_v2/test_cumulative_compaction_with_format_v2.groovy b/regression-test/suites/inverted_index_p0/index_format_v2/test_cumulative_compaction_with_format_v2.groovy
index a010aff5a47..2dc65192497 100644
--- a/regression-test/suites/inverted_index_p0/index_format_v2/test_cumulative_compaction_with_format_v2.groovy
+++ b/regression-test/suites/inverted_index_p0/index_format_v2/test_cumulative_compaction_with_format_v2.groovy
@@ -168,7 +168,7 @@ suite("test_cumulative_compaction_with_format_v2", "inverted_index_format_v2") {
"""
sql """ sync """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_select_default """ SELECT * FROM ${tableName} t WHERE city MATCH 'Beijing' ORDER BY user_id,date,city,age,sex,last_visit_date,last_update_date,last_visit_date_not_null,cost,max_dwell_time,min_dwell_time; """
diff --git a/regression-test/suites/inverted_index_p0/index_format_v2/test_drop_column_with_format_v2.groovy b/regression-test/suites/inverted_index_p0/index_format_v2/test_drop_column_with_format_v2.groovy
index 2de9c7fcbcb..cef30bd7a4a 100644
--- a/regression-test/suites/inverted_index_p0/index_format_v2/test_drop_column_with_format_v2.groovy
+++ b/regression-test/suites/inverted_index_p0/index_format_v2/test_drop_column_with_format_v2.groovy
@@ -95,7 +95,7 @@ suite("test_drop_column_with_format_v2", "inverted_index_format_v2"){
sql """ INSERT INTO ${tableName} VALUES (2, "bason", 99); """
sql """ INSERT INTO ${tableName} VALUES (3, "andy", 100); """
sql """ INSERT INTO ${tableName} VALUES (3, "bason", 99); """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql "SELECT * FROM $tableName WHERE name match 'andy' order by id, name, score;"
diff --git a/regression-test/suites/inverted_index_p0/index_format_v2/test_drop_index_with_format_v2.groovy b/regression-test/suites/inverted_index_p0/index_format_v2/test_drop_index_with_format_v2.groovy
index e572535109e..ef2cb273874 100644
--- a/regression-test/suites/inverted_index_p0/index_format_v2/test_drop_index_with_format_v2.groovy
+++ b/regression-test/suites/inverted_index_p0/index_format_v2/test_drop_index_with_format_v2.groovy
@@ -74,7 +74,7 @@ suite("test_drop_index_with_format_v2", "inverted_index_format_v2"){
sql """ INSERT INTO ${tableName} VALUES (2, "bason", 99); """
sql """ INSERT INTO ${tableName} VALUES (3, "andy", 100); """
sql """ INSERT INTO ${tableName} VALUES (3, "bason", 99); """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql "SELECT * FROM $tableName WHERE name match 'andy' order by id, name, score;"
diff --git a/regression-test/suites/inverted_index_p0/index_format_v2/test_mor_table_with_format_v2.groovy b/regression-test/suites/inverted_index_p0/index_format_v2/test_mor_table_with_format_v2.groovy
index 4f8c99695b7..28e94cc6193 100644
--- a/regression-test/suites/inverted_index_p0/index_format_v2/test_mor_table_with_format_v2.groovy
+++ b/regression-test/suites/inverted_index_p0/index_format_v2/test_mor_table_with_format_v2.groovy
@@ -166,7 +166,7 @@ suite("test_mor_table_with_format_v2", "inverted_index_format_v2") {
"""
sql """ sync """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ DELETE FROM ${tableName} WHERE user_id = 3 """
diff --git a/regression-test/suites/inverted_index_p0/index_format_v2/test_mow_table_with_format_v2.groovy b/regression-test/suites/inverted_index_p0/index_format_v2/test_mow_table_with_format_v2.groovy
index d4c3c29b87c..3dacfe71a65 100644
--- a/regression-test/suites/inverted_index_p0/index_format_v2/test_mow_table_with_format_v2.groovy
+++ b/regression-test/suites/inverted_index_p0/index_format_v2/test_mow_table_with_format_v2.groovy
@@ -167,7 +167,7 @@ suite("test_mow_table_with_format_v2", "inverted_index_format_v2") {
"""
sql """ sync """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_select_default """ SELECT * FROM ${tableName} t WHERE city MATCH 'Beijing' ORDER BY user_id,date,city,age,sex,last_visit_date,last_update_date,last_visit_date_not_null,cost,max_dwell_time,min_dwell_time; """
diff --git a/regression-test/suites/inverted_index_p0/index_format_v2/test_rename_column_with_format_v2.groovy b/regression-test/suites/inverted_index_p0/index_format_v2/test_rename_column_with_format_v2.groovy
index baaff078520..a5d5f3ee288 100644
--- a/regression-test/suites/inverted_index_p0/index_format_v2/test_rename_column_with_format_v2.groovy
+++ b/regression-test/suites/inverted_index_p0/index_format_v2/test_rename_column_with_format_v2.groovy
@@ -67,7 +67,7 @@ suite("test_rename_column_with_format_v2", "inverted_index_format_v2"){
sql """ INSERT INTO ${tableName} VALUES (2, "bason", 99); """
sql """ INSERT INTO ${tableName} VALUES (3, "andy", 100); """
sql """ INSERT INTO ${tableName} VALUES (3, "bason", 99); """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql "SELECT * FROM $tableName WHERE name match 'andy' order by id, name, score;"
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 b4a3db04aec..453b057bdb8 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,8 +16,7 @@
// 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 "SET enable_segment_limit_pushdown=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 78ce558b7d3..658b8dccdf7 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,8 +16,7 @@
// 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"
+ sql "SET enable_segment_limit_pushdown=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 697a4116d2a..5a7ef74fdee 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,8 +24,7 @@
// 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_segment_limit_pushdown=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 b0acf1ab21d..3c2aaad446b 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,8 +16,7 @@
// 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 "SET enable_segment_limit_pushdown=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/inverted_index_p0/storage_format/test_storage_format_v1.groovy b/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_v1.groovy
index 6d5e1917fe1..977e21d43f9 100644
--- a/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_v1.groovy
+++ b/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_v1.groovy
@@ -98,7 +98,7 @@ suite("test_storage_format_v1", "p0") {
create_httplogs_dup_table.call(testTable_dup)
load_httplogs_data.call(testTable_dup, 'test_httplogs_load_count_on_index', 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql(" select COUNT(*) from ${testTable_dup} where request match 'images' ")
diff --git a/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_v2.groovy b/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_v2.groovy
index 8996d0989a6..7782a5eee17 100644
--- a/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_v2.groovy
+++ b/regression-test/suites/inverted_index_p0/storage_format/test_storage_format_v2.groovy
@@ -82,7 +82,7 @@ suite("test_storage_format_v2", "p0, nonConcurrent") {
}
try {
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
sql "DROP TABLE IF EXISTS ${testTable}"
create_httplogs_dup_table.call(testTable)
diff --git a/regression-test/suites/inverted_index_p0/test_arrayInvertedIdx_profile.groovy b/regression-test/suites/inverted_index_p0/test_arrayInvertedIdx_profile.groovy
index 576c31cc8d5..b7d566c9cbf 100644
--- a/regression-test/suites/inverted_index_p0/test_arrayInvertedIdx_profile.groovy
+++ b/regression-test/suites/inverted_index_p0/test_arrayInvertedIdx_profile.groovy
@@ -59,9 +59,8 @@ suite("test_arrayInvertedIdx_profile", "nonConcurrent"){
}
}
- // If we use common expr pass to inverted index , we should set enable_common_expr_pushdown = true
- sql """ set enable_common_expr_pushdown = true; """
- sql """ set enable_common_expr_pushdown_for_inverted_index = true; """
+ // Pin enable_segment_limit_pushdown to keep inverted-index pushdown stable under fuzzy testing
+ sql """ set enable_segment_limit_pushdown = true; """
sql """ set enable_profile = true;"""
sql """ set profile_level = 2;"""
diff --git a/regression-test/suites/inverted_index_p0/test_array_contains_with_inverted_index.groovy b/regression-test/suites/inverted_index_p0/test_array_contains_with_inverted_index.groovy
index d0f99d31109..daacdd33a2c 100644
--- a/regression-test/suites/inverted_index_p0/test_array_contains_with_inverted_index.groovy
+++ b/regression-test/suites/inverted_index_p0/test_array_contains_with_inverted_index.groovy
@@ -19,9 +19,8 @@ suite("test_array_contains_with_inverted_index"){
// prepare test table
def indexTblName = "tai"
- // If we use common expr pass to inverted index , we should set enable_common_expr_pushdown = true
- sql """ set enable_common_expr_pushdown = true; """
- sql """ set enable_common_expr_pushdown_for_inverted_index = true; """
+ // Pin enable_segment_limit_pushdown to keep inverted-index pushdown stable under fuzzy testing
+ sql """ set enable_segment_limit_pushdown = true; """
sql """ set enable_profile = true;"""
sql "DROP TABLE IF EXISTS ${indexTblName}"
@@ -61,7 +60,7 @@ suite("test_array_contains_with_inverted_index"){
sql """ INSERT INTO `${indexTblName}`(`apply_date`, `id`, `inventors`) VALUES ('2019-01-01', '0974e7a82e30d1af83205e474fadd0a2', '[\"w\"]'); """
sql """ INSERT INTO `${indexTblName}`(`apply_date`, `id`, `inventors`) VALUES ('2019-01-01', '26823b3995ee38bd145ddd910b2f6300', '[\"x\"]'); """
sql """ INSERT INTO `${indexTblName}`(`apply_date`, `id`, `inventors`) VALUES ('2019-01-01', 'ee27ee1da291e46403c408e220bed6e1', '[\"y\"]'); """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql """ select count() from ${indexTblName}"""
def param_contains = ["\'s\'", "\'\'", null]
@@ -85,23 +84,23 @@ suite("test_array_contains_with_inverted_index"){
for (int i = 0 ; i < param.size(); ++i) {
def p = param[i]
log.info("param: ${p}")
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where arrays_overlap(inventors, ${p}) order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where arrays_overlap(inventors, ${p}) order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where arrays_overlap(inventors, ${p}) and apply_date = '2019-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where arrays_overlap(inventors, ${p}) and apply_date = '2019-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where arrays_overlap(inventors, ${p}) or apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where arrays_overlap(inventors, ${p}) or apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where !arrays_overlap(inventors, ${p}) order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where !arrays_overlap(inventors, ${p}) order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where !arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where !arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where !arrays_overlap(inventors, ${p}) and apply_date = '2019-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where !arrays_overlap(inventors, ${p}) and apply_date = '2019-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where !arrays_overlap(inventors, ${p}) or apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where !arrays_overlap(inventors, ${p}) or apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where (arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01') or apply_date = '2019-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where (arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01') or apply_date = '2019-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ * from tai where arrays_overlap(inventors, ${p}) order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ * from tai where arrays_overlap(inventors, ${p}) order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ * from tai where arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ * from tai where arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ * from tai where arrays_overlap(inventors, ${p}) and apply_date = '2019-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ * from tai where arrays_overlap(inventors, ${p}) and apply_date = '2019-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ * from tai where arrays_overlap(inventors, ${p}) or apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ * from tai where arrays_overlap(inventors, ${p}) or apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ * from tai where !arrays_overlap(inventors, ${p}) order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ * from tai where !arrays_overlap(inventors, ${p}) order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ * from tai where !arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ * from tai where !arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ * from tai where !arrays_overlap(inventors, ${p}) and apply_date = '2019-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ * from tai where !arrays_overlap(inventors, ${p}) and apply_date = '2019-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ * from tai where !arrays_overlap(inventors, ${p}) or apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ * from tai where !arrays_overlap(inventors, ${p}) or apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ * from tai where (arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01') or apply_date = '2019-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ * from tai where (arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01') or apply_date = '2019-01-01' order by id; """
}
}
diff --git a/regression-test/suites/inverted_index_p0/test_array_index.groovy b/regression-test/suites/inverted_index_p0/test_array_index.groovy
index ba6e1e1f398..f84a5ceb176 100644
--- a/regression-test/suites/inverted_index_p0/test_array_index.groovy
+++ b/regression-test/suites/inverted_index_p0/test_array_index.groovy
@@ -59,7 +59,7 @@ suite("test_array_index1"){
"disable_auto_compaction" = "false"
);
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ INSERT INTO `${indexTblName}`(`apply_date`, `id`, `inventors`) VALUES ('2017-01-01', '6afef581285b6608bf80d5a4e46cf839', '[\"a\", \"b\", \"c\"]'); """
sql """ INSERT INTO `${indexTblName}`(`apply_date`, `id`, `inventors`) VALUES ('2017-01-01', 'd93d942d985a8fb7547c72dada8d332d', '[\"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\"]'); """
diff --git a/regression-test/suites/inverted_index_p0/test_array_inverted_index/sql/insert_with_query.sql b/regression-test/suites/inverted_index_p0/test_array_inverted_index/sql/insert_with_query.sql
index c0f6cd28495..a54de85f91c 100644
--- a/regression-test/suites/inverted_index_p0/test_array_inverted_index/sql/insert_with_query.sql
+++ b/regression-test/suites/inverted_index_p0/test_array_inverted_index/sql/insert_with_query.sql
@@ -32,7 +32,7 @@ WHERE ( Array_contains(table1 .
'r') ) order by 1,2,3,4;
-- set session variables for inverted index
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ col_int_undef_signed_not_null, col_date_undef_signed_not_null, col_bigint_undef_signed_not_null_index_inverted, col_bigint_undef_signed_not_null, Month (Ifnull(table1 . `col_date_undef_signed_not_null_index_inverted`,
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ col_int_undef_signed_not_null, col_date_undef_signed_not_null, col_bigint_undef_signed_not_null_index_inverted, col_bigint_undef_signed_not_null, Month (Ifnull(table1 . `col_date_undef_signed_not_null_index_inverted`,
table1 .
col_date_undef_signed)) AS field1,
table1 . col_date_undef_signed_not_null AS field2,
diff --git a/regression-test/suites/inverted_index_p0/test_array_with_inverted_index_all_type.groovy b/regression-test/suites/inverted_index_p0/test_array_with_inverted_index_all_type.groovy
index d8e8575a052..a8ab5d54d7c 100644
--- a/regression-test/suites/inverted_index_p0/test_array_with_inverted_index_all_type.groovy
+++ b/regression-test/suites/inverted_index_p0/test_array_with_inverted_index_all_type.groovy
@@ -31,9 +31,8 @@ suite("test_array_with_inverted_index_all_type"){
def dataFile = """test_array_with_inverted_index_all_type.json"""
def dataFileAgg = """test_array_with_inverted_index_all_type_agg.json"""
sql """ set enable_profile = true;"""
- // If we use common expr pass to inverted index , we should set enable_common_expr_pushdown = true
- sql """ set enable_common_expr_pushdown = true; """
- sql """ set enable_common_expr_pushdown_for_inverted_index = true; """
+ // Pin enable_segment_limit_pushdown to keep inverted-index pushdown stable under fuzzy testing
+ sql """ set enable_segment_limit_pushdown = true; """
// duplicate key table with all type using standard parser for inverted index
sql "DROP TABLE IF EXISTS ${indexTblNames[0]}"
@@ -277,7 +276,7 @@ suite("test_array_with_inverted_index_all_type"){
}
// query test
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
for (int i = 0; i < 6; i+=1) {
def indexTblName = indexTblNames[i]
diff --git a/regression-test/suites/inverted_index_p0/test_bm25_score.groovy b/regression-test/suites/inverted_index_p0/test_bm25_score.groovy
index 3a8ad125dc5..e75ec2f1455 100644
--- a/regression-test/suites/inverted_index_p0/test_bm25_score.groovy
+++ b/regression-test/suites/inverted_index_p0/test_bm25_score.groovy
@@ -76,7 +76,7 @@ suite("test_bm25_score", "p0") {
load_httplogs_data.call('test_bm25_score', 'test_bm25_score', 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
def explain_result = sql """ explain verbose select *, score() as score from test_bm25_score where request match_any 'button.03.gif' order by score limit 10; """
log.info("Explain verbose result: ${explain_result}")
@@ -218,7 +218,7 @@ suite("test_bm25_score", "p0") {
sql """ insert into t1 values(2, 2, '{"key": "abc hhh"}'); """
sql """ sync """
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
sql """ alter table t1 add index idx_v(v) USING INVERTED PROPERTIES("parser"="english", "support_phrase"=true); """
wait_for_latest_op_on_table_finish("t1", timeout)
@@ -227,7 +227,7 @@ suite("test_bm25_score", "p0") {
}
try {
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = 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; """
@@ -280,7 +280,7 @@ suite("test_bm25_score", "p0") {
sql """ insert into t2 values(4,4, "hello world"); """
sql """ sync """
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
sql """ alter table t2 add index idx_s(s) USING INVERTED PROPERTIES("parser"="english", "support_phrase"=true); """
wait_for_latest_op_on_table_finish("t2", timeout)
diff --git a/regression-test/suites/inverted_index_p0/test_bm25_score_range_filter.groovy b/regression-test/suites/inverted_index_p0/test_bm25_score_range_filter.groovy
index 240b67ef24a..56aed446165 100644
--- a/regression-test/suites/inverted_index_p0/test_bm25_score_range_filter.groovy
+++ b/regression-test/suites/inverted_index_p0/test_bm25_score_range_filter.groovy
@@ -43,7 +43,7 @@ suite("test_bm25_score_range_filter", "p0") {
sql """ INSERT INTO ${tableName} VALUES (8, 'apple apple banana cherry'); """
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// Test 1: Basic score range filter with GT (>)
qt_score_gt """
diff --git a/regression-test/suites/inverted_index_p0/test_bm25_score_variant.groovy b/regression-test/suites/inverted_index_p0/test_bm25_score_variant.groovy
index 885d311bdfc..8db0207a364 100644
--- a/regression-test/suites/inverted_index_p0/test_bm25_score_variant.groovy
+++ b/regression-test/suites/inverted_index_p0/test_bm25_score_variant.groovy
@@ -20,7 +20,7 @@ suite("test_bm25_score_variant", "p0") {
return
}
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = 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/test_chinese_analyzer.groovy b/regression-test/suites/inverted_index_p0/test_chinese_analyzer.groovy
index 417c829ca80..1dc5f483881 100644
--- a/regression-test/suites/inverted_index_p0/test_chinese_analyzer.groovy
+++ b/regression-test/suites/inverted_index_p0/test_chinese_analyzer.groovy
@@ -98,7 +98,7 @@ suite("test_chinese_analyzer"){
"replication_allocation" = "tag.location.default: 1"
);
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql "INSERT INTO $indexTblName3 VALUES (1, '我来到北京清华大学'), (2, '我爱你中国'), (3, '人民可以得到更多实惠'), (4, '陕西省西安市高新区创业大厦A座,我的手机号码是12345678901,邮箱是12345678@qq.com,,ip是1.1.1.1,this information is created automatically.');"
qt_sql "SELECT * FROM $indexTblName3 WHERE c MATCH_PHRASE '我爱你' ORDER BY id;"
diff --git a/regression-test/suites/inverted_index_p0/test_complex_or_null_semantics.groovy b/regression-test/suites/inverted_index_p0/test_complex_or_null_semantics.groovy
index de5f0efcb84..1ad1942afa7 100644
--- a/regression-test/suites/inverted_index_p0/test_complex_or_null_semantics.groovy
+++ b/regression-test/suites/inverted_index_p0/test_complex_or_null_semantics.groovy
@@ -79,7 +79,7 @@ suite("test_complex_or_null_semantics") {
(30, 'Misc', 'Random content', 'Anonymous', 'Misc')
"""
- sql "SET enable_common_expr_pushdown = true"
+ sql "SET enable_segment_limit_pushdown = true"
// Test 1: The core bug scenario - cross-field OR with one field NULL
// title:ALL("Philosophy") OR content:ALL("Disney+ Hotstar")
diff --git a/regression-test/suites/inverted_index_p0/test_compound.groovy b/regression-test/suites/inverted_index_p0/test_compound.groovy
index e1f8034114e..c9a730282fe 100644
--- a/regression-test/suites/inverted_index_p0/test_compound.groovy
+++ b/regression-test/suites/inverted_index_p0/test_compound.groovy
@@ -57,7 +57,7 @@ suite("test_compound", "p0"){
(9, '9', '9', '9'),
(10, '10', '10', '10');
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql "SELECT count() FROM $indexTblName WHERE (id >= 2 AND id < 9) and (a match '2' or b match '5' and c match '5');"
qt_sql "SELECT count() FROM $indexTblName WHERE (id >= 2 AND id < 9) and (a match '2' or b match '5' or c match '6');"
diff --git a/regression-test/suites/inverted_index_p0/test_compound_1.groovy b/regression-test/suites/inverted_index_p0/test_compound_1.groovy
index a8aca4b526b..38e98e40a45 100644
--- a/regression-test/suites/inverted_index_p0/test_compound_1.groovy
+++ b/regression-test/suites/inverted_index_p0/test_compound_1.groovy
@@ -80,15 +80,15 @@ suite("test_compound_1", "p0"){
load_httplogs_data.call(indexTbName, 'test_compound_1', 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql """ select count() from ${indexTbName} where (request match_phrase 'english' and clientip match_phrase '4' or request match_phrase 'images'); """
qt_sql """ select count() from ${indexTbName} where (request match_phrase 'hm' and clientip match_phrase '3' or request match_phrase 'gif'); """
qt_sql """ select count() from ${indexTbName} where (request match_phrase 'french' and clientip match_phrase '2' or request match_phrase 'jpg'); """
- qt_sql """ select /*+ SET_VAR(enable_common_expr_pushdown = false) */ count() from ${indexTbName} where (request match_phrase 'english' and clientip match_phrase '4' or request match_phrase 'images'); """
- qt_sql """ select /*+ SET_VAR(enable_common_expr_pushdown = false) */ count() from ${indexTbName} where (request match_phrase 'hm' and clientip match_phrase '3' or request match_phrase 'gif'); """
- qt_sql """ select /*+ SET_VAR(enable_common_expr_pushdown = false) */ count() from ${indexTbName} where (request match_phrase 'french' and clientip match_phrase '2' or request match_phrase 'jpg'); """
+ qt_sql """ select /*+ SET_VAR(enable_segment_limit_pushdown = false) */ count() from ${indexTbName} where (request match_phrase 'english' and clientip match_phrase '4' or request match_phrase 'images'); """
+ qt_sql """ select /*+ SET_VAR(enable_segment_limit_pushdown = false) */ count() from ${indexTbName} where (request match_phrase 'hm' and clientip match_phrase '3' or request match_phrase 'gif'); """
+ qt_sql """ select /*+ SET_VAR(enable_segment_limit_pushdown = false) */ count() from ${indexTbName} where (request match_phrase 'french' and clientip match_phrase '2' or request match_phrase 'jpg'); """
} finally {
//try_sql("DROP TABLE IF EXISTS ${testTable}")
diff --git a/regression-test/suites/inverted_index_p0/test_compound_inlist.groovy b/regression-test/suites/inverted_index_p0/test_compound_inlist.groovy
index d49b1df03c3..d6c1c3cdaf2 100644
--- a/regression-test/suites/inverted_index_p0/test_compound_inlist.groovy
+++ b/regression-test/suites/inverted_index_p0/test_compound_inlist.groovy
@@ -103,7 +103,7 @@ suite("test_compound_inlist", "nonConcurrent"){
load_httplogs_data.call(indexTbName2, 'test_compound_list_2', 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql """ select /*+ SET_VAR(inverted_index_skip_threshold = 0) */ count() from ${indexTbName1} where (((request match_phrase 'images' and clientip match_phrase '3') or (request match_phrase 'english' and clientip match_phrase '4')) and status in (1, 2, 304)); """
qt_sql """ select /*+ SET_VAR(inverted_index_skip_threshold = 0) */ count() from ${indexTbName2} where (((request match_phrase 'images' and clientip match_phrase '3') or (request match_phrase 'english' and clientip match_phrase '4')) and status in (1, 2, 304)); """
@@ -135,7 +135,7 @@ suite("test_compound_inlist", "nonConcurrent"){
qt_sql """ select /*+ SET_VAR(inverted_index_skip_threshold = 0) */ count() from ${indexTbName1} where ((request match_phrase 'hm' and clientip match_phrase '1') or (request match_phrase 'jpg' and clientip match_phrase '2')) or (((request match_phrase 'images' and clientip match_phrase '3') or (request match_phrase 'english' and clientip match_phrase '4')) and status in (1, 2, 304, 200) and status not in (1, 2, 304)); """
qt_sql """ select /*+ SET_VAR(inverted_index_skip_threshold = 0) */ count() from ${indexTbName2} where ((request match_phrase 'hm' and clientip match_phrase '1') or (request match_phrase 'jpg' and clientip match_phrase '2')) or (((request match_phrase 'images' and clientip match_phrase '3') or (request match_phrase 'english' and clientip match_phrase '4')) and status in (1, 2, 304, 200) and status not in (1, 2, 304)); """
- sql """ set enable_common_expr_pushdown = false; """
+ sql """ set enable_segment_limit_pushdown = false; """
qt_sql """ select /*+ SET_VAR(inverted_index_skip_threshold = 0) */ count() from ${indexTbName1} where (((request match_phrase 'images' and clientip match_phrase '3') or (request match_phrase 'english' and clientip match_phrase '4')) and status in (1, 2, 304)); """
qt_sql """ select /*+ SET_VAR(inverted_index_skip_threshold = 0) */ count() from ${indexTbName2} where (((request match_phrase 'images' and clientip match_phrase '3') or (request match_phrase 'english' and clientip match_phrase '4')) and status in (1, 2, 304)); """
@@ -167,7 +167,7 @@ suite("test_compound_inlist", "nonConcurrent"){
qt_sql """ select /*+ SET_VAR(inverted_index_skip_threshold = 0) */ count() from ${indexTbName1} where ((request match_phrase 'hm' and clientip match_phrase '1') or (request match_phrase 'jpg' and clientip match_phrase '2')) or (((request match_phrase 'images' and clientip match_phrase '3') or (request match_phrase 'english' and clientip match_phrase '4')) and status in (1, 2, 304, 200) and status not in (1, 2, 304)); """
qt_sql """ select /*+ SET_VAR(inverted_index_skip_threshold = 0) */ count() from ${indexTbName2} where ((request match_phrase 'hm' and clientip match_phrase '1') or (request match_phrase 'jpg' and clientip match_phrase '2')) or (((request match_phrase 'images' and clientip match_phrase '3') or (request match_phrase 'english' and clientip match_phrase '4')) and status in (1, 2, 304, 200) and status not in (1, 2, 304)); """
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
} finally {
//try_sql("DROP TABLE IF EXISTS ${testTable}")
diff --git a/regression-test/suites/inverted_index_p0/test_count_on_index.groovy b/regression-test/suites/inverted_index_p0/test_count_on_index.groovy
index 9823124df50..30d3164d3ad 100644
--- a/regression-test/suites/inverted_index_p0/test_count_on_index.groovy
+++ b/regression-test/suites/inverted_index_p0/test_count_on_index.groovy
@@ -141,7 +141,7 @@ suite("test_count_on_index_httplogs", "p0") {
stream_load_data.call(testTable_unique, 'test_httplogs_load_count_on_index', 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """set experimental_enable_nereids_planner=true;"""
sql """set enable_fallback_to_original_planner=false;"""
sql """analyze table ${testTable_dup} with sync""";
diff --git a/regression-test/suites/inverted_index_p0/test_count_on_index_2.groovy b/regression-test/suites/inverted_index_p0/test_count_on_index_2.groovy
index 59e9904574c..4b8198e0f41 100644
--- a/regression-test/suites/inverted_index_p0/test_count_on_index_2.groovy
+++ b/regression-test/suites/inverted_index_p0/test_count_on_index_2.groovy
@@ -153,7 +153,7 @@ suite("test_count_on_index_2", "p0"){
load_httplogs_data.call(indexTbName2, indexTbName2, 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql """ select count() from ${indexTbName1} where `@timestamp` >= 893964736 and `@timestamp` <= 893966453; """
qt_sql """ select count() from ${indexTbName2} where `@timestamp` >= 893964736 and `@timestamp` <= 893966453; """
diff --git a/regression-test/suites/inverted_index_p0/test_cross_field_or_with_null.groovy b/regression-test/suites/inverted_index_p0/test_cross_field_or_with_null.groovy
index f3454380330..410f5019ae7 100644
--- a/regression-test/suites/inverted_index_p0/test_cross_field_or_with_null.groovy
+++ b/regression-test/suites/inverted_index_p0/test_cross_field_or_with_null.groovy
@@ -71,7 +71,7 @@ suite("test_cross_field_or_with_null") {
// Test 1: Simple cross-field OR with NULL
// title MATCH "Philosophy" OR content MATCH "Disney+ Hotstar"
// Expected: Rows 1-16 (rows 1-15 have title match, row 16 has content match)
- sql "SET enable_common_expr_pushdown = true"
+ sql "SET enable_segment_limit_pushdown = true"
def result1_match = sql """
SELECT COUNT(*) FROM ${tableName}
@@ -163,7 +163,7 @@ suite("test_cross_field_or_with_null") {
logger.info("Test 5 passed: AND with cross-field OR containing NULL")
// Test 6: Test with pushdown disabled (should also work correctly)
- sql "SET enable_common_expr_pushdown = false"
+ sql "SET enable_segment_limit_pushdown = false"
def result6_nopush = sql """
SELECT COUNT(*) FROM ${tableName}
@@ -174,7 +174,7 @@ suite("test_cross_field_or_with_null") {
logger.info("Test 6 passed: Query works correctly without pushdown")
// Test 7: Multiple OR conditions with different NULL patterns
- sql "SET enable_common_expr_pushdown = true"
+ sql "SET enable_segment_limit_pushdown = true"
def result7_match = sql """
SELECT COUNT(*) FROM ${tableName}
diff --git a/regression-test/suites/inverted_index_p0/test_delete.groovy b/regression-test/suites/inverted_index_p0/test_delete.groovy
index 8cdb4cf859f..05b53207622 100644
--- a/regression-test/suites/inverted_index_p0/test_delete.groovy
+++ b/regression-test/suites/inverted_index_p0/test_delete.groovy
@@ -46,7 +46,7 @@ suite("test_delete"){
"disable_auto_compaction" = "false"
);
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ INSERT INTO `${indexTblName}`(`a`, `b`, `c`) VALUES ('1', '6afef581285b6608bf80d5a4e46cf839', 'aaa'), ('2', '48a33ec3453a28bce84b8f96fe161956', 'bbb'),
('3', '021603e7dcfe65d44af0efd0e5aee154', 'ccc'), ('4', 'ee27ee1da291e46403c408e220bed6e1', 'ddd'),
diff --git a/regression-test/suites/inverted_index_p0/test_empty_string_match.groovy b/regression-test/suites/inverted_index_p0/test_empty_string_match.groovy
index 798e0100f1b..aa3c7e916e2 100644
--- a/regression-test/suites/inverted_index_p0/test_empty_string_match.groovy
+++ b/regression-test/suites/inverted_index_p0/test_empty_string_match.groovy
@@ -40,7 +40,7 @@ suite("test_empty_string_match", "p0") {
(4, 'data', 'some text');
"""
- sql "SET enable_common_expr_pushdown = true"
+ sql "SET enable_segment_limit_pushdown = true"
// Test 1: Empty string match on keyword index (index path)
// Should match rows where keyword_col is empty string (rows 1 and 3)
diff --git a/regression-test/suites/inverted_index_p0/test_equal_on_fulltext.groovy b/regression-test/suites/inverted_index_p0/test_equal_on_fulltext.groovy
index debb5b07e35..f9b4c0770d0 100644
--- a/regression-test/suites/inverted_index_p0/test_equal_on_fulltext.groovy
+++ b/regression-test/suites/inverted_index_p0/test_equal_on_fulltext.groovy
@@ -45,7 +45,7 @@ suite("test_equal_on_fulltext", "p0"){
def var_result = sql "show variables"
logger.info("show variales result: " + var_result )
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql "INSERT INTO $indexTblName VALUES (1, 'I am the person'), (2, 'I am a person'), (3, 'I am your person');"
qt_sql "SELECT * FROM $indexTblName WHERE c = 'I am a person' ORDER BY id;"
diff --git a/regression-test/suites/inverted_index_p0/test_expr_in_null.groovy b/regression-test/suites/inverted_index_p0/test_expr_in_null.groovy
index bee677630ce..8123640fbef 100644
--- a/regression-test/suites/inverted_index_p0/test_expr_in_null.groovy
+++ b/regression-test/suites/inverted_index_p0/test_expr_in_null.groovy
@@ -37,7 +37,7 @@ suite("test_expr_in_null", "p0"){
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ set enable_inverted_index_query = true """
qt_sql """
diff --git a/regression-test/suites/inverted_index_p0/test_float_double.groovy b/regression-test/suites/inverted_index_p0/test_float_double.groovy
index b8f46d0a17f..2f76737d3f9 100644
--- a/regression-test/suites/inverted_index_p0/test_float_double.groovy
+++ b/regression-test/suites/inverted_index_p0/test_float_double.groovy
@@ -21,7 +21,7 @@ suite("test_float_double", "p0, nonConcurrent"){
sql """ set describe_extend_variant_column = true """
sql """ set enable_match_without_inverted_index = false """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ set inverted_index_skip_threshold = 0 """
def queryAndCheck = { String sqlQuery, int expectedFilteredRows = -1, boolean checkFilterUsed = true ->
diff --git a/regression-test/suites/inverted_index_p0/test_ignore_above_in_index.groovy b/regression-test/suites/inverted_index_p0/test_ignore_above_in_index.groovy
index bde764fa332..9a9adf959dd 100644
--- a/regression-test/suites/inverted_index_p0/test_ignore_above_in_index.groovy
+++ b/regression-test/suites/inverted_index_p0/test_ignore_above_in_index.groovy
@@ -84,7 +84,7 @@ suite("test_ignore_above_in_index", "p0") {
assertTrue(json.NumberLoadedRows > 0 && json.LoadBytes > 0)
}
}
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_sql "select count() from ${tableName2} where clientip > '17.0';"
qt_sql "select count() from ${tableName2} where clientip > '17.0' or status = 200;"
}
diff --git a/regression-test/suites/inverted_index_p0/test_index_chinese_column.groovy b/regression-test/suites/inverted_index_p0/test_index_chinese_column.groovy
index 9cb659b7896..d69224ce206 100644
--- a/regression-test/suites/inverted_index_p0/test_index_chinese_column.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_chinese_column.groovy
@@ -37,7 +37,7 @@ suite("test_index_chinese_column", "inverted_index_select"){
def table_name_v2 = "test_index_chinese_column_v2"
sql "set enable_unicode_name_support=true"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
createAndInsertData(table_name_v2, "V2")
}
diff --git a/regression-test/suites/inverted_index_p0/test_index_complex_match.groovy b/regression-test/suites/inverted_index_p0/test_index_complex_match.groovy
index 0b77c4aec51..2f498d43bcb 100644
--- a/regression-test/suites/inverted_index_p0/test_index_complex_match.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_complex_match.groovy
@@ -101,7 +101,7 @@ suite("test_index_complex_match", "p0"){
load_httplogs_data.call(indexTbName2, indexTbName2, 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql """ select count() from ${indexTbName1} where clientip match_phrase '247.37.0.0'; """
qt_sql """ select count() from ${indexTbName1} where clientip match_phrase_prefix '247'; """
diff --git a/regression-test/suites/inverted_index_p0/test_index_delete.groovy b/regression-test/suites/inverted_index_p0/test_index_delete.groovy
index 8b9474d937b..650c86d01ca 100644
--- a/regression-test/suites/inverted_index_p0/test_index_delete.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_delete.groovy
@@ -49,7 +49,7 @@ suite("test_index_delete", "p0") {
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ delete from ${indexTbName1} where a >= 9; """
sql "sync"
diff --git a/regression-test/suites/inverted_index_p0/test_index_empty_string.groovy b/regression-test/suites/inverted_index_p0/test_index_empty_string.groovy
index 05232ec6bc6..b2c72a19d8a 100644
--- a/regression-test/suites/inverted_index_p0/test_index_empty_string.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_empty_string.groovy
@@ -47,7 +47,7 @@ suite("test_index_empty_string", "p0"){
(1, '', '1'),
(2, '2', '');
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql "SELECT count() FROM $indexTblName WHERE a match '';"
qt_sql "SELECT count() FROM $indexTblName WHERE b match '';"
}
diff --git a/regression-test/suites/inverted_index_p0/test_index_equal_select.groovy b/regression-test/suites/inverted_index_p0/test_index_equal_select.groovy
index c062b7438c5..a783c749ecf 100644
--- a/regression-test/suites/inverted_index_p0/test_index_equal_select.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_equal_select.groovy
@@ -54,7 +54,7 @@ suite("test_index_equal_select", "inverted_index_select"){
("san zhang", 10, "grade 5", "2017-10-01", "tall:100cm, weight: 30kg, hobbies:", "", "", "", "", ""),
("li sisi", 11, "grade 6", "2016-10-01", "tall:150cm, weight: 40kg, hobbies: sing, dancing, running", "good at handiwork and beaty", "", "li ba", "li liuliu", "")
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
// case1: test equal
// case1.0: test index coulume equal ‘’
diff --git a/regression-test/suites/inverted_index_p0/test_index_key_match_select.groovy b/regression-test/suites/inverted_index_p0/test_index_key_match_select.groovy
index a9d9df943f8..bdc43022a4f 100644
--- a/regression-test/suites/inverted_index_p0/test_index_key_match_select.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_key_match_select.groovy
@@ -44,7 +44,7 @@ suite("test_index_key_match_select", "inverted_index_select"){
("u3", ["u1"]),
("u4", ["u3"])
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql "SELECT * FROM ${indexTbName1} WHERE user MATCH_ANY 'u1, u2' ORDER BY user LIMIT 10;"
qt_sql "SELECT * FROM ${indexTbName1} WHERE user MATCH_ANY 'u1, u2, u3' ORDER BY user LIMIT 10;"
}
\ No newline at end of file
diff --git a/regression-test/suites/inverted_index_p0/test_index_lowercase_fault_injection.groovy b/regression-test/suites/inverted_index_p0/test_index_lowercase_fault_injection.groovy
index 51f0eea5d88..f40c889a171 100644
--- a/regression-test/suites/inverted_index_p0/test_index_lowercase_fault_injection.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_lowercase_fault_injection.groovy
@@ -63,7 +63,7 @@ suite("test_index_lowercase_fault_injection", "nonConcurrent") {
sql """ INSERT INTO ${testTable} VALUES (893964653, '232.0.0.0', 'GET /images/hm_bg.jpg HTTP/1.0', 200, 3781); """
sql 'sync'
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql """ select count() from ${testTable} where (request match 'HTTP'); """
qt_sql """ select count() from ${testTable} where (request match 'http'); """
diff --git a/regression-test/suites/inverted_index_p0/test_index_match_phrase.groovy b/regression-test/suites/inverted_index_p0/test_index_match_phrase.groovy
index f7e793f8490..b40051b54a4 100644
--- a/regression-test/suites/inverted_index_p0/test_index_match_phrase.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_match_phrase.groovy
@@ -155,7 +155,7 @@ suite("test_index_match_phrase_select", "inverted_index_select"){
wait_for_build_index_on_partition_finish(indexTbName1, timeout)
}
}
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// case1: test match_phrase ""
try {
diff --git a/regression-test/suites/inverted_index_p0/test_index_match_phrase_edge.groovy b/regression-test/suites/inverted_index_p0/test_index_match_phrase_edge.groovy
index 189f1fe5216..34209532dd3 100644
--- a/regression-test/suites/inverted_index_p0/test_index_match_phrase_edge.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_match_phrase_edge.groovy
@@ -56,7 +56,7 @@ suite("test_index_match_phrase_edge", "nonConcurrent"){
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
GetDebugPoint().enableDebugPointForAllBEs("VMatchPredicate.execute")
qt_sql """ select * from ${indexTbName1} where b match_phrase_edge 'x.h'; """
@@ -161,7 +161,7 @@ suite("test_index_match_phrase_edge", "nonConcurrent"){
load_httplogs_data.call(indexTbName3, indexTbName3, 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
sql "set disable_nereids_rules='CHECK_MATCH_EXPRESSION';"
GetDebugPoint().enableDebugPointForAllBEs("VMatchPredicate.execute")
diff --git a/regression-test/suites/inverted_index_p0/test_index_match_phrase_ordered.groovy b/regression-test/suites/inverted_index_p0/test_index_match_phrase_ordered.groovy
index 0f563835e86..0570cffad00 100644
--- a/regression-test/suites/inverted_index_p0/test_index_match_phrase_ordered.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_match_phrase_ordered.groovy
@@ -108,7 +108,7 @@ suite("test_index_match_phrase_ordered", "nonConcurrent"){
load_httplogs_data.call(indexTbName2, 'test_index_match_phrase_ordered_2', 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
GetDebugPoint().enableDebugPointForAllBEs("VMatchPredicate.execute")
qt_sql """ select count() from ${indexTbName1} where b match_phrase 'the lazy'; """
diff --git a/regression-test/suites/inverted_index_p0/test_index_match_phrase_prefix.groovy b/regression-test/suites/inverted_index_p0/test_index_match_phrase_prefix.groovy
index 3906065e8d3..1ad64f0dc17 100644
--- a/regression-test/suites/inverted_index_p0/test_index_match_phrase_prefix.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_match_phrase_prefix.groovy
@@ -98,7 +98,7 @@ suite("test_index_match_phrase_prefix", "nonConcurrent"){
load_httplogs_data.call(indexTbName2, indexTbName2, 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
GetDebugPoint().enableDebugPointForAllBEs("VMatchPredicate.execute")
qt_sql """ select count() from ${indexTbName1} where request match_phrase_prefix 'ima'; """
qt_sql """ select count() from ${indexTbName1} where request match_phrase_prefix 'images/h'; """
diff --git a/regression-test/suites/inverted_index_p0/test_index_match_phrase_prefix_1.groovy b/regression-test/suites/inverted_index_p0/test_index_match_phrase_prefix_1.groovy
index 5ee38c9e403..057d89291be 100644
--- a/regression-test/suites/inverted_index_p0/test_index_match_phrase_prefix_1.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_match_phrase_prefix_1.groovy
@@ -51,7 +51,7 @@ suite("test_index_match_phrase_prefix_1", "nonConcurrent"){
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
GetDebugPoint().enableDebugPointForAllBEs("VMatchPredicate.execute")
qt_sql """ select count() from ${indexTbName1} where c match_phrase_prefix 'O1704361998540E2Cemx9S'; """
diff --git a/regression-test/suites/inverted_index_p0/test_index_match_phrase_slop.groovy b/regression-test/suites/inverted_index_p0/test_index_match_phrase_slop.groovy
index 5f772e0e7a4..3a51d3bc8a2 100644
--- a/regression-test/suites/inverted_index_p0/test_index_match_phrase_slop.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_match_phrase_slop.groovy
@@ -82,7 +82,7 @@ suite("test_index_match_phrase_slop", "nonConcurrent"){
sql """ INSERT INTO ${indexTbName1} VALUES (1, "127.0.0.1", "I'm glad I kept my fingers crossed ~4", 1, 1); """
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
GetDebugPoint().enableDebugPointForAllBEs("VMatchPredicate.execute")
qt_sql """ select count() from ${indexTbName1} where request match_phrase 'get jpg'; """
diff --git a/regression-test/suites/inverted_index_p0/test_index_match_regexp.groovy b/regression-test/suites/inverted_index_p0/test_index_match_regexp.groovy
index 00af9113150..47f5a3bb5dc 100644
--- a/regression-test/suites/inverted_index_p0/test_index_match_regexp.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_match_regexp.groovy
@@ -79,7 +79,7 @@ suite("test_index_match_regexp", "nonConcurrent"){
load_httplogs_data.call(indexTbName1, 'test_index_match_regexp', 'true', 'json', 'documents-1000.json')
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
GetDebugPoint().enableDebugPointForAllBEs("VMatchPredicate.execute")
qt_sql """ select count() from test_index_match_regexp where request match_regexp ''; """
diff --git a/regression-test/suites/inverted_index_p0/test_index_match_select.groovy b/regression-test/suites/inverted_index_p0/test_index_match_select.groovy
index 45eda4f1ddb..3607a9db495 100644
--- a/regression-test/suites/inverted_index_p0/test_index_match_select.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_match_select.groovy
@@ -154,7 +154,7 @@ suite("test_index_match_select", "inverted_index_select"){
wait_for_build_index_on_partition_finish(indexTbName1, timeout)
}
}
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// case1: match term
// case1.0 test match ""
diff --git a/regression-test/suites/inverted_index_p0/test_index_multi_match.groovy b/regression-test/suites/inverted_index_p0/test_index_multi_match.groovy
index ca3547e06ab..e6b65aa1542 100644
--- a/regression-test/suites/inverted_index_p0/test_index_multi_match.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_multi_match.groovy
@@ -93,7 +93,7 @@ suite("test_index_multi_match", "p0"){
sql "sync"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql """ select count() from ${indexTbName2} where (clientip match_phrase_prefix '2'); """
qt_sql """ select count() from ${indexTbName2} where (clientip match_phrase_prefix '2' or request match_phrase_prefix '2'); """
diff --git a/regression-test/suites/inverted_index_p0/test_index_no_need_read_data.groovy b/regression-test/suites/inverted_index_p0/test_index_no_need_read_data.groovy
index c0e205ec953..6bea50c1819 100644
--- a/regression-test/suites/inverted_index_p0/test_index_no_need_read_data.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_no_need_read_data.groovy
@@ -53,7 +53,7 @@ suite("test_index_no_need_read_data", "inverted_index_select"){
"""
// case1: enable nereids planner
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_select_nereids_0 "SELECT * FROM ${table1} ORDER BY id"
qt_select_nereids_1 "SELECT count() FROM ${table1} WHERE n > 100"
diff --git a/regression-test/suites/inverted_index_p0/test_index_null.groovy b/regression-test/suites/inverted_index_p0/test_index_null.groovy
index 82cf9a3f95f..2a398763744 100644
--- a/regression-test/suites/inverted_index_p0/test_index_null.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_null.groovy
@@ -42,7 +42,7 @@ suite("test__null_index", "inverted_index"){
"replication_allocation" = "tag.location.default: 1"
);
"""
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
sql "INSERT INTO $indexTblName VALUES (1, []), (2, []), (3, []);"
qt_sql "SELECT * FROM $indexTblName WHERE value match_all 'a';"
}
diff --git a/regression-test/suites/inverted_index_p0/test_index_range_between_select.groovy b/regression-test/suites/inverted_index_p0/test_index_range_between_select.groovy
index 6e4f3168885..267af636308 100644
--- a/regression-test/suites/inverted_index_p0/test_index_range_between_select.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_range_between_select.groovy
@@ -117,7 +117,7 @@ suite("test_index_range_between_select", "inverted_index_select"){
"""
wait_for_latest_op_on_table_finish(indexTbName1, timeout)
}
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// case1: test simple between case
// case1.0: test data index colume select in specific between condition
diff --git a/regression-test/suites/inverted_index_p0/test_index_range_bigger_and_equal_select.groovy b/regression-test/suites/inverted_index_p0/test_index_range_bigger_and_equal_select.groovy
index 41333fdca0d..efabbcb7109 100644
--- a/regression-test/suites/inverted_index_p0/test_index_range_bigger_and_equal_select.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_range_bigger_and_equal_select.groovy
@@ -54,7 +54,7 @@ suite("test_index_range_bigger_and_equal_select", "inverted_index_select"){
("san zhang", 10, "grade 5", "2017-10-01", "tall:100cm, weight: 30kg, hobbies:", "", "", "", "", ""),
("li sisi", 11, "grade 6", "2016-10-01", "tall:150cm, weight: 40kg, hobbies: sing, dancing, running", "good at handiwork and beaty", "", "li ba", "li liuliu", "")
"""
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// case1. test >=
// case1.0: test only >=
qt_sql "select * from ${indexTbName1} where name>='' order by name "
diff --git a/regression-test/suites/inverted_index_p0/test_index_range_bigger_select.groovy b/regression-test/suites/inverted_index_p0/test_index_range_bigger_select.groovy
index d84313c2da3..d2de6645772 100644
--- a/regression-test/suites/inverted_index_p0/test_index_range_bigger_select.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_range_bigger_select.groovy
@@ -54,7 +54,7 @@ suite("test_index_range_bigger_select", "inverted_index_select"){
("san zhang", 10, "grade 5", "2017-10-01", "tall:100cm, weight: 30kg, hobbies:", "", "", "", "", ""),
("li sisi", 11, "grade 6", "2016-10-01", "tall:150cm, weight: 40kg, hobbies: sing, dancing, running", "good at handiwork and beaty", "", "li ba", "li liuliu", "")
"""
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// case1. test >
// case1.0: test only >
qt_sql "select * from ${indexTbName1} where name>'' order by name "
diff --git a/regression-test/suites/inverted_index_p0/test_index_range_in_select.groovy b/regression-test/suites/inverted_index_p0/test_index_range_in_select.groovy
index a169aef3fe5..9cd28239c4d 100644
--- a/regression-test/suites/inverted_index_p0/test_index_range_in_select.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_range_in_select.groovy
@@ -153,7 +153,7 @@ suite("test_index_range_in_select", "inverted_index_select"){
wait_for_build_index_on_partition_finish(indexTbName1, timeout)
}
}
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// case1: select in
// case1.0: select in specific condition
diff --git a/regression-test/suites/inverted_index_p0/test_index_range_not_in_select.groovy b/regression-test/suites/inverted_index_p0/test_index_range_not_in_select.groovy
index 179ac47b28c..bb9d0dba141 100644
--- a/regression-test/suites/inverted_index_p0/test_index_range_not_in_select.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_range_not_in_select.groovy
@@ -111,7 +111,7 @@ suite("test_index_range_not_in_select", "inverted_index_select"){
}
assertTrue(useTime <= OpTimeout, "wait_for_latest_build_index_on_partition_finish timeout")
}
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
for (int i = 0; i < 2; i++) {
logger.info("select table with index times " + i)
diff --git a/regression-test/suites/inverted_index_p0/test_index_range_smaller_and_equal_select.groovy b/regression-test/suites/inverted_index_p0/test_index_range_smaller_and_equal_select.groovy
index b4133754459..4ccb4419f65 100644
--- a/regression-test/suites/inverted_index_p0/test_index_range_smaller_and_equal_select.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_range_smaller_and_equal_select.groovy
@@ -54,7 +54,7 @@ suite("test_index_range_smaller_and_equal_select", "inverted_index_select"){
("san zhang", 10, "grade 5", "2017-10-01", "tall:100cm, weight: 30kg, hobbies:", "", "", "", "", ""),
("li sisi", 11, "grade 6", "2016-10-01", "tall:150cm, weight: 40kg, hobbies: sing, dancing, running", "good at handiwork and beaty", "", "li ba", "li liuliu", "")
"""
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// case1. test <=
// case1.0: test only <=
qt_sql "select * from ${indexTbName1} where name<='' order by name"
diff --git a/regression-test/suites/inverted_index_p0/test_index_range_smaller_select.groovy b/regression-test/suites/inverted_index_p0/test_index_range_smaller_select.groovy
index 9c9f0b120d6..2e1ce2f263f 100644
--- a/regression-test/suites/inverted_index_p0/test_index_range_smaller_select.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_range_smaller_select.groovy
@@ -54,7 +54,7 @@ suite("test_index_range_smaller_select", "inverted_index_select"){
("san zhang", 10, "grade 5", "2017-10-01", "tall:100cm, weight: 30kg, hobbies:", "", "", "", "", ""),
("li sisi", 11, "grade 6", "2016-10-01", "tall:150cm, weight: 40kg, hobbies: sing, dancing, running", "good at handiwork and beaty", "", "li ba", "li liuliu", "")
"""
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// case1. test <
// case1.0: test only <
sql "select * from ${indexTbName1} where name<'' order by name "
diff --git a/regression-test/suites/inverted_index_p0/test_index_rqg_bug.groovy b/regression-test/suites/inverted_index_p0/test_index_rqg_bug.groovy
index 02762e57983..277975c275b 100644
--- a/regression-test/suites/inverted_index_p0/test_index_rqg_bug.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_rqg_bug.groovy
@@ -142,7 +142,7 @@ suite("test_index_rqg_bug", "test_index_rqg_bug"){
(48, -10, 7, 3, 4, -1290467110130692882, NULL, -5421887030808227301, 2147894047624029750, '2023-12-20', '2026-02-18', '2023-12-10', '2024-02-18', 'v', 'f', 'u', 'z', 'w', 'l', 'i', 'b'),
(49, 4, -10, -10, -4, 7177870619817484302, 2010854013707344984, 515636226818986547, -4617727694631456148, '2023-12-14', '2024-01-09', '2023-12-11', '2024-01-08', 'k', 'o', 'r', 'h', 'x', 'v', 'm', 'r');
"""
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_select_bug_1 """
SELECT
MIN(DISTINCT table1.col_date_undef_signed_not_null) AS field1,
diff --git a/regression-test/suites/inverted_index_p0/test_index_rqg_bug2.groovy b/regression-test/suites/inverted_index_p0/test_index_rqg_bug2.groovy
index e1411a70437..3db864cbcbf 100644
--- a/regression-test/suites/inverted_index_p0/test_index_rqg_bug2.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_rqg_bug2.groovy
@@ -82,7 +82,7 @@ suite("test_index_rqg_bug2", "test_index_rqg_bug"){
sql """
INSERT INTO ${table1}(pk,col_int_undef_signed,col_int_undef_signed_index_inverted,col_int_undef_signed_not_null,col_int_undef_signed_not_null_index_inverted,col_bigint_undef_signed,col_bigint_undef_signed_index_inverted,col_bigint_undef_signed_not_null,col_bigint_undef_signed_not_null_index_inverted,col_date_undef_signed,col_date_undef_signed_index_inverted,col_date_undef_signed_not_null,col_date_undef_signed_not_null_index_inverted,col_varchar_10__undef_signed,col_varchar_10__undef_ [...]
"""
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_select_bug_2 """
SELECT
table1.col_date_undef_signed_not_null_index_inverted,
diff --git a/regression-test/suites/inverted_index_p0/test_index_rqg_bug3.groovy b/regression-test/suites/inverted_index_p0/test_index_rqg_bug3.groovy
index 8fa4cdc4b80..849b8c13934 100644
--- a/regression-test/suites/inverted_index_p0/test_index_rqg_bug3.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_rqg_bug3.groovy
@@ -63,7 +63,7 @@ suite("test_index_rqg_bug3", "test_index_rqg_bug3"){
sql """
insert into ${table1}(pk,col_int_undef_signed,col_int_undef_signed_index_inverted,col_int_undef_signed_not_null,col_int_undef_signed_not_null_index_inverted,col_bigint_undef_signed,col_bigint_undef_signed_index_inverted,col_bigint_undef_signed_not_null,col_bigint_undef_signed_not_null_index_inverted,col_date_undef_signed,col_date_undef_signed_index_inverted,col_date_undef_signed_not_null,col_date_undef_signed_not_null_index_inverted,col_varchar_10__undef_signed,col_varchar_10__undef_ [...]
"""
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_select_bug_1 """
SELECT col_int_undef_signed_not_null, col_date_undef_signed_not_null
FROM ${table1} AS table1
diff --git a/regression-test/suites/inverted_index_p0/test_index_rqg_bug4.groovy b/regression-test/suites/inverted_index_p0/test_index_rqg_bug4.groovy
index b29532c12c3..41e3c178f6b 100644
--- a/regression-test/suites/inverted_index_p0/test_index_rqg_bug4.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_rqg_bug4.groovy
@@ -126,7 +126,7 @@ suite("test_index_rqg_bug4", "test_index_rqg_bug"){
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_sql """
select
diff --git a/regression-test/suites/inverted_index_p0/test_index_skip_read_data.groovy b/regression-test/suites/inverted_index_p0/test_index_skip_read_data.groovy
index 1c4a92a26d7..eca5fecc656 100644
--- a/regression-test/suites/inverted_index_p0/test_index_skip_read_data.groovy
+++ b/regression-test/suites/inverted_index_p0/test_index_skip_read_data.groovy
@@ -21,7 +21,7 @@ suite("test_index_skip_read_data", "p0"){
def indexTbName2 = "test_index_skip_read_data_mow"
def indexTbName3 = "test_index_skip_read_data_mor"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// dup
sql "DROP TABLE IF EXISTS ${indexTbName1}"
diff --git a/regression-test/suites/inverted_index_p0/test_inverted_index.groovy b/regression-test/suites/inverted_index_p0/test_inverted_index.groovy
index ff719eed032..db64881a724 100644
--- a/regression-test/suites/inverted_index_p0/test_inverted_index.groovy
+++ b/regression-test/suites/inverted_index_p0/test_inverted_index.groovy
@@ -21,7 +21,7 @@ suite("test_inverted_index", "inverted_index") {
def jobStateResult = sql """ SHOW ALTER TABLE COLUMN WHERE TableName='${tableName}' ORDER BY createtime DESC LIMIT 1 """
return jobStateResult[0][9]
}
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
sql "DROP TABLE IF EXISTS ${tbName1}"
sql """
CREATE TABLE IF NOT EXISTS ${tbName1} (
diff --git a/regression-test/suites/inverted_index_p0/test_inverted_index_collection_stats.groovy b/regression-test/suites/inverted_index_p0/test_inverted_index_collection_stats.groovy
index 2b118436c07..9a03e32889d 100644
--- a/regression-test/suites/inverted_index_p0/test_inverted_index_collection_stats.groovy
+++ b/regression-test/suites/inverted_index_p0/test_inverted_index_collection_stats.groovy
@@ -43,8 +43,7 @@ suite('test_inverted_index_collection_stats', 'p0') {
// Enable profile
sql """ set enable_profile = true; """
sql """ set profile_level = 2; """
- sql """ set enable_common_expr_pushdown = true; """
- sql """ set enable_common_expr_pushdown_for_inverted_index = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// Execute MATCH_ALL query which triggers CollectionStatistics::collect
def queryId = "test_inverted_index_collection_stats_${System.currentTimeMillis()}"
diff --git a/regression-test/suites/inverted_index_p0/test_inverted_index_io_timer.groovy b/regression-test/suites/inverted_index_p0/test_inverted_index_io_timer.groovy
index 43bbe78ba12..dc2cb37bf98 100644
--- a/regression-test/suites/inverted_index_p0/test_inverted_index_io_timer.groovy
+++ b/regression-test/suites/inverted_index_p0/test_inverted_index_io_timer.groovy
@@ -97,8 +97,7 @@ suite('test_inverted_index_io_timer', 'p0') {
sql """ set enable_sql_cache = false; """
sql """ set enable_inverted_index_searcher_cache = false; """
sql """ set enable_inverted_index_query_cache = false; """
- sql """ set enable_common_expr_pushdown = true; """
- sql """ set enable_common_expr_pushdown_for_inverted_index = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
sql """ set enable_match_without_inverted_index = false; """
// Execute query with inverted index using profile
diff --git a/regression-test/suites/inverted_index_p0/test_inverted_index_keyword.groovy b/regression-test/suites/inverted_index_p0/test_inverted_index_keyword.groovy
index fbc584d7dd4..ca4152cc230 100644
--- a/regression-test/suites/inverted_index_p0/test_inverted_index_keyword.groovy
+++ b/regression-test/suites/inverted_index_p0/test_inverted_index_keyword.groovy
@@ -68,7 +68,7 @@ suite("test_inverted_index_keyword"){
(3, '我在北京市'),
(3, '我在西安市')
"""
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_sql "SELECT * FROM ${indexTblName} where c match '330204195805121025'";
qt_sql "SELECT * FROM ${indexTblName} where c match '36'";
qt_sql "SELECT * FROM ${indexTblName} where c match '330225197806187713'";
diff --git a/regression-test/suites/inverted_index_p0/test_inverted_index_mor.groovy b/regression-test/suites/inverted_index_p0/test_inverted_index_mor.groovy
index 64073b18610..37fd4016d80 100644
--- a/regression-test/suites/inverted_index_p0/test_inverted_index_mor.groovy
+++ b/regression-test/suites/inverted_index_p0/test_inverted_index_mor.groovy
@@ -48,7 +48,7 @@ suite("test_inverted_index_mor", "p0"){
sql """ INSERT INTO $indexTblName VALUES (1, 2, 12, 1.2, '1 2'), (3, 4, 34, 3.4, '3 4'); """
sql """ INSERT INTO $indexTblName VALUES (11, 12, 1112, 11.12, '11 22'), (13, 14, 1314, 13.14, '13 14'); """
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
// original data
qt_11 """ SELECT * FROM $indexTblName ORDER BY k1,k2 """
diff --git a/regression-test/suites/inverted_index_p0/test_inverted_index_null.groovy b/regression-test/suites/inverted_index_p0/test_inverted_index_null.groovy
index b9c8ed6119a..b4af93de92d 100644
--- a/regression-test/suites/inverted_index_p0/test_inverted_index_null.groovy
+++ b/regression-test/suites/inverted_index_p0/test_inverted_index_null.groovy
@@ -53,7 +53,7 @@ suite("test_inverted_index_null") {
(7,'tengxun','qie','addr gg','lj',null),
(8,'tengxun2','qie',null,'lj',800)
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
// select all data
qt_select_0 "SELECT * FROM ${table1} ORDER BY id"
diff --git a/regression-test/suites/inverted_index_p0/test_inverted_index_null_ram_dir.groovy b/regression-test/suites/inverted_index_p0/test_inverted_index_null_ram_dir.groovy
index 425cea7b4cf..37a5a124b15 100644
--- a/regression-test/suites/inverted_index_p0/test_inverted_index_null_ram_dir.groovy
+++ b/regression-test/suites/inverted_index_p0/test_inverted_index_null_ram_dir.groovy
@@ -105,7 +105,7 @@ suite("test_inverted_index_null_ram_dir") {
(7,'tengxun','qie','addr gg','lj',null),
(8,'tengxun2','qie',null,'lj',800)
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
// select all data
qt_select_0 "SELECT * FROM ${tableName} ORDER BY id"
diff --git a/regression-test/suites/inverted_index_p0/test_inverted_index_v2_file_size.groovy b/regression-test/suites/inverted_index_p0/test_inverted_index_v2_file_size.groovy
index c0eae0ccd4a..b9994e57ecf 100644
--- a/regression-test/suites/inverted_index_p0/test_inverted_index_v2_file_size.groovy
+++ b/regression-test/suites/inverted_index_p0/test_inverted_index_v2_file_size.groovy
@@ -83,7 +83,7 @@ suite("test_index_index_V2_file_size", "nonConcurrent") {
//TabletId,ReplicaId,BackendId,SchemaHash,Version,LstSuccessVersion,LstFailedVersion,LstFailedTime,LocalDataSize,RemoteDataSize,RowCount,State,LstConsistencyCheckTime,CheckVersion,VersionCount,PathHash,MetaUrl,CompactionStatus
def tablets = sql_return_maparray """ show tablets from ${tableName}; """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ INSERT INTO ${tableName} VALUES (1, "andy", "andy love apple", 100); """
sql """ INSERT INTO ${tableName} VALUES (1, "bason", "bason hate pear", 99); """
diff --git a/regression-test/suites/inverted_index_p0/test_inverted_is_null.groovy b/regression-test/suites/inverted_index_p0/test_inverted_is_null.groovy
index 20987910d67..89afe253418 100644
--- a/regression-test/suites/inverted_index_p0/test_inverted_is_null.groovy
+++ b/regression-test/suites/inverted_index_p0/test_inverted_is_null.groovy
@@ -42,7 +42,7 @@ suite("test_inverted_is_null", "p0") {
(4, NULL, 'qux', 10)
"""
- sql "SET enable_common_expr_pushdown=true"
+ sql "SET enable_segment_limit_pushdown=true"
sql "SET inverted_index_skip_threshold=0"
def nullBranchQuery = """
diff --git a/regression-test/suites/inverted_index_p0/test_ip_cidr_search_with_inverted_index.groovy b/regression-test/suites/inverted_index_p0/test_ip_cidr_search_with_inverted_index.groovy
index cc2b871142b..93cc250797c 100644
--- a/regression-test/suites/inverted_index_p0/test_ip_cidr_search_with_inverted_index.groovy
+++ b/regression-test/suites/inverted_index_p0/test_ip_cidr_search_with_inverted_index.groovy
@@ -47,7 +47,7 @@ suite("test_ip_cidr_search_with_inverted_index", "nonConcurrent"){
qt_sql """ select count() from tc_ip_cidr_search_with_inverted_index"""
// without inverted index query
- sql """ set enable_common_expr_pushdown = false; """
+ sql """ set enable_segment_limit_pushdown = false; """
sql """ set enable_inverted_index_query=false; """
// select ipv6 in ipv4 cidr
qt_sql_without_ii_0 """ select id, ipv4, ipv6, is_ip_address_in_range(ipv6, '255.255.255.255/12') from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv6, '255.255.255.255/12') order by id; """
@@ -68,8 +68,8 @@ suite("test_ip_cidr_search_with_inverted_index", "nonConcurrent"){
qt_sql_without_ii_9 """ select id, ipv4, ipv6, is_ip_address_in_range(ipv6, null) from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv6, null) order by id; """
// with inverted index query
- // If we use common expr pass to inverted index , we should set enable_common_expr_pushdown = true
- sql """ set enable_common_expr_pushdown = true; """
+ // Pin enable_segment_limit_pushdown to keep inverted-index pushdown stable under fuzzy testing
+ sql """ set enable_segment_limit_pushdown = true; """
sql """ set enable_inverted_index_query=true; """
sql """ set inverted_index_skip_threshold = 0; """ // set skip threshold to 0
diff --git a/regression-test/suites/inverted_index_p0/test_is_null_expr.groovy b/regression-test/suites/inverted_index_p0/test_is_null_expr.groovy
index 22f890f9223..ebfd675c63f 100644
--- a/regression-test/suites/inverted_index_p0/test_is_null_expr.groovy
+++ b/regression-test/suites/inverted_index_p0/test_is_null_expr.groovy
@@ -52,8 +52,8 @@ suite("test_is_null_expr", "p0, nonConcurrent") {
GetDebugPoint().enableDebugPointForAllBEs(checkpoints_name, [filtered_rows: expectedFilteredRows])
sql "set experimental_enable_parallel_scan = false"
sql " set inverted_index_skip_threshold = 0 "
- sql " set enable_common_expr_pushdown_for_inverted_index = true"
- sql " set enable_common_expr_pushdown = true"
+ sql " set enable_segment_limit_pushdown = true"
+ sql " set enable_segment_limit_pushdown = true"
sql " set enable_parallel_scan = false"
sql "sync"
sql "${sqlQuery}"
diff --git a/regression-test/suites/inverted_index_p0/test_lowercase.groovy b/regression-test/suites/inverted_index_p0/test_lowercase.groovy
index 3de3b3da732..7526d305e47 100644
--- a/regression-test/suites/inverted_index_p0/test_lowercase.groovy
+++ b/regression-test/suites/inverted_index_p0/test_lowercase.groovy
@@ -56,7 +56,7 @@ suite("test_lowercase"){
"replication_allocation" = "tag.location.default: 1"
);
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql "INSERT INTO $indexTblName2 VALUES (1, 'hello 我来到北京清华大学'), (2, 'HELLO 我爱你中国'), (3, 'Hello 人民可以得到更多实惠');"
qt_sql "SELECT * FROM $indexTblName2 WHERE c MATCH 'hello' ORDER BY id";
diff --git a/regression-test/suites/inverted_index_p0/test_match_or_null_semantics.groovy b/regression-test/suites/inverted_index_p0/test_match_or_null_semantics.groovy
index f869490bd35..b875f0e123a 100644
--- a/regression-test/suites/inverted_index_p0/test_match_or_null_semantics.groovy
+++ b/regression-test/suites/inverted_index_p0/test_match_or_null_semantics.groovy
@@ -18,7 +18,7 @@
suite("test_match_or_null_semantics") {
// This test verifies the fix for the bug in InvertedIndexResultBitmap::operator|=()
// in inverted_index_reader.h where NULL bitmaps were incorrectly combined using OR
- // instead of AND for MATCH syntax queries with enable_common_expr_pushdown=true
+ // instead of AND for MATCH syntax queries with enable_segment_limit_pushdown=true
//
// Bug location: be/src/olap/rowset/segment_v2/inverted_index_reader.h:138
// The bug caused rows with (TRUE OR NULL) to be incorrectly filtered out
@@ -70,7 +70,7 @@ suite("test_match_or_null_semantics") {
"""
// Enable pushdown to trigger the bug in InvertedIndexResultBitmap::operator|=
- sql "SET enable_common_expr_pushdown = true"
+ sql "SET enable_segment_limit_pushdown = true"
// Test 1: Core bug scenario - cross-field OR with NULL
// Before fix: returned 1 row (only row 16, lost 15 rows with NULL content)
@@ -147,7 +147,7 @@ suite("test_match_or_null_semantics") {
logger.info("Test 7 PASSED: NOT OR with NULL correctly excludes all rows")
// Test 8: Verify behavior without pushdown (should still work correctly)
- sql "SET enable_common_expr_pushdown = false"
+ sql "SET enable_segment_limit_pushdown = false"
def test8 = sql """
SELECT COUNT(*) FROM ${tableName}
diff --git a/regression-test/suites/inverted_index_p0/test_match_query_without_index.groovy b/regression-test/suites/inverted_index_p0/test_match_query_without_index.groovy
index 61a564c51d8..4eb46a943d0 100644
--- a/regression-test/suites/inverted_index_p0/test_match_query_without_index.groovy
+++ b/regression-test/suites/inverted_index_p0/test_match_query_without_index.groovy
@@ -59,7 +59,7 @@ suite("test_match_query_without_index", "inverted_index_select"){
("san zhang", "grade 5", "", "", "", 10, "2017-10-01", "tall:100cm, weight: 30kg, hobbies:", "", ""),
("li sisi", "grade 6", "li ba", "li liuliu", "", 11, "2016-10-01", "tall:150cm, weight: 40kg, hobbies: sing, dancing, running", "good at handiwork and beaty", "")
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
// case1: match any
try {
sql """ select * from ${indexTbName1} where ${varchar_colume1} match_any "" order by name; """
diff --git a/regression-test/suites/inverted_index_p0/test_need_read_data.groovy b/regression-test/suites/inverted_index_p0/test_need_read_data.groovy
index 9c80019e46a..62b82b926ca 100644
--- a/regression-test/suites/inverted_index_p0/test_need_read_data.groovy
+++ b/regression-test/suites/inverted_index_p0/test_need_read_data.groovy
@@ -73,7 +73,7 @@ suite("test_need_read_data", "p0"){
sql """ insert into ${indexTbName1}(pk,col_int_undef_signed,col_int_undef_signed_index_inverted,col_int_undef_signed_not_null,col_int_undef_signed_not_null_index_inverted,col_bigint_undef_signed,col_bigint_undef_signed_index_inverted,col_bigint_undef_signed_not_null,col_bigint_undef_signed_not_null_index_inverted,col_date_undef_signed,col_date_undef_signed_index_inverted,col_date_undef_signed_not_null,col_date_undef_signed_not_null_index_inverted,col_varchar_10__undef_signed,col_ [...]
sql "sync"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql """ SELECT COUNT( *) AS field1, col_int_undef_signed AS field2 FROM ${indexTbName1} WHERE( col_date_undef_signed_not_null_index_inverted == '2024-01-01' OR day( col_date_undef_signed_not_null_index_inverted ) !=0 ) GROUP BY field2 ORDER BY field2; """
@@ -136,8 +136,8 @@ suite("test_need_read_data", "p0"){
logger.info("show variales result: " + var_result )
sql "INSERT INTO ${indexTblName3} VALUES (1, 1),(1, -2),(1, -1);"
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=false,inverted_index_skip_threshold=100) */ id FROM ${indexTblName3} WHERE value<0 and abs(value)>1;"
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true,inverted_index_skip_threshold=100) */ id FROM ${indexTblName3} WHERE value<0 and abs(value)>1;"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown = false,inverted_index_skip_threshold=100) */ id FROM ${indexTblName3} WHERE value<0 and abs(value)>1;"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true,inverted_index_skip_threshold=100) */ id FROM ${indexTblName3} WHERE value<0 and abs(value)>1;"
sql "DROP TABLE IF EXISTS tt"
sql """
diff --git a/regression-test/suites/inverted_index_p0/test_no_index_match.groovy b/regression-test/suites/inverted_index_p0/test_no_index_match.groovy
index dafdb645531..5571416cd01 100644
--- a/regression-test/suites/inverted_index_p0/test_no_index_match.groovy
+++ b/regression-test/suites/inverted_index_p0/test_no_index_match.groovy
@@ -84,7 +84,7 @@ suite("test_no_index_match", "p0") {
sql """ INSERT INTO ${testTable} VALUES (1, '1', '', 1, 1); """
sql 'sync'
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
try {
qt_sql """ select count() from ${testTable} where (request match_any 'hm bg'); """
diff --git a/regression-test/suites/inverted_index_p0/test_null_index.groovy b/regression-test/suites/inverted_index_p0/test_null_index.groovy
index a11e3dde7c4..e0eed2e84cd 100644
--- a/regression-test/suites/inverted_index_p0/test_null_index.groovy
+++ b/regression-test/suites/inverted_index_p0/test_null_index.groovy
@@ -44,7 +44,7 @@ suite("test_null_index", "p0"){
"replication_allocation" = "tag.location.default: 1"
);
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql "INSERT INTO $indexTblName VALUES (1, 'a', null, [null], [1]), (2, 'b', 'b', ['b'], [2]), (3, 'c', 'c', ['c'], [3]);"
qt_sql "SELECT * FROM $indexTblName WHERE str match null order by id;"
qt_sql "SELECT * FROM $indexTblName WHERE str_null match null order by id;"
@@ -70,7 +70,7 @@ suite("test_null_index", "p0"){
"replication_allocation" = "tag.location.default: 1"
);
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql "INSERT INTO $indexTblName2 VALUES (1, 'a', null, [null], [1]), (2, 'b', 'b', ['b'], [2]), (3, 'c', 'c', ['c'], [3]);"
qt_sql "SELECT * FROM $indexTblName2 WHERE str match null order by id;"
qt_sql "SELECT * FROM $indexTblName2 WHERE str_null match null order by id;"
diff --git a/regression-test/suites/inverted_index_p0/test_or_not_match.groovy b/regression-test/suites/inverted_index_p0/test_or_not_match.groovy
index 488639aae6e..e14ef526195 100644
--- a/regression-test/suites/inverted_index_p0/test_or_not_match.groovy
+++ b/regression-test/suites/inverted_index_p0/test_or_not_match.groovy
@@ -64,7 +64,7 @@ suite("test_or_not_match", "p0") {
sql "set enable_nereids_planner = true"
sql "set enable_fallback_to_original_planner = false"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql "select request from ${tableName} where request like '1.0' or not request MATCH 'GETA' order by request limit 2;"
}
diff --git a/regression-test/suites/inverted_index_p0/test_pinyin_phrase.groovy b/regression-test/suites/inverted_index_p0/test_pinyin_phrase.groovy
index a766c1e5512..606b64cb7d6 100644
--- a/regression-test/suites/inverted_index_p0/test_pinyin_phrase.groovy
+++ b/regression-test/suites/inverted_index_p0/test_pinyin_phrase.groovy
@@ -58,7 +58,7 @@ suite("test_pinyin_phrase", "p0") {
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_sql_1 """ SELECT a, ch FROM ${indexTbName} WHERE search('ch:"合作"') ORDER BY a; """
qt_sql_2 """ SELECT a, ch FROM ${indexTbName} WHERE search('ch:"高峰论坛"') ORDER BY a; """
diff --git a/regression-test/suites/inverted_index_p0/test_pk_no_need_read_data.groovy b/regression-test/suites/inverted_index_p0/test_pk_no_need_read_data.groovy
index 1641d0e3e16..8b7d6d41b03 100644
--- a/regression-test/suites/inverted_index_p0/test_pk_no_need_read_data.groovy
+++ b/regression-test/suites/inverted_index_p0/test_pk_no_need_read_data.groovy
@@ -54,7 +54,7 @@ suite("test_pk_no_need_read_data", "p0"){
// case1: enable count on index
sql "set enable_count_on_index_pushdown = true"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_select_0 "SELECT COUNT() FROM ${table1} WHERE date='2017-10-01'"
qt_select_1 "SELECT COUNT() FROM ${table1} WHERE year(date)='2017'"
diff --git a/regression-test/suites/inverted_index_p0/test_search_or_null_semantics.groovy b/regression-test/suites/inverted_index_p0/test_search_or_null_semantics.groovy
index 9d310115299..81450a8b379 100644
--- a/regression-test/suites/inverted_index_p0/test_search_or_null_semantics.groovy
+++ b/regression-test/suites/inverted_index_p0/test_search_or_null_semantics.groovy
@@ -73,13 +73,13 @@ suite("test_search_or_null_semantics") {
(20, 'Tech Article', NULL, 'Academic', 'Education')
"""
- sql "SET enable_common_expr_pushdown = true"
+ sql "SET enable_segment_limit_pushdown = true"
// Test 1: The core bug scenario - cross-field OR with one field NULL
// Before fix: SEARCH returned 1 row (only row 16, lost 15 rows with NULL content)
// After fix: SEARCH returns 16 rows (rows 1-16)
def test1 = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableName}
WHERE SEARCH('title:ALL(Philosophy) OR content:ALL("Disney+ Hotstar")')
"""
@@ -88,7 +88,7 @@ suite("test_search_or_null_semantics") {
// Test 2: Verify the 15 critical rows are included
def test2 = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableName}
WHERE title MATCH_ALL 'Philosophy'
AND content IS NULL
AND SEARCH('title:ALL(Philosophy) OR content:ALL("Disney+ Hotstar")')
@@ -99,7 +99,7 @@ suite("test_search_or_null_semantics") {
// Test 3: Three-way OR with different NULL patterns
def test3 = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableName}
WHERE SEARCH('title:ALL(Philosophy) OR content:ALL("Disney+ Hotstar") OR author:ANY(Political)')
"""
@@ -108,7 +108,7 @@ suite("test_search_or_null_semantics") {
// Test 4: OR within AND with NULL
def test4 = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableName}
WHERE SEARCH('category:Education AND (title:ALL(Philosophy) OR content:ALL(Disney))')
"""
@@ -118,7 +118,7 @@ suite("test_search_or_null_semantics") {
// Test 5: Deeply nested OR with multiple NULL fields
def test5 = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableName}
WHERE SEARCH('
(title:ALL(Philosophy) OR content:ALL(Disney))
OR (author:ANY(Writer) OR category:Technology)
@@ -132,13 +132,13 @@ suite("test_search_or_null_semantics") {
// Test 6: Verify SQL three-valued logic truth table for OR
// TRUE OR NULL = TRUE
def test6a = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableName}
WHERE (title MATCH_ALL 'Philosophy' AND content IS NULL)
"""
assertEquals(15, test6a[0][0], "Should have 15 rows with TRUE OR NULL pattern")
def test6b = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableName}
WHERE (title MATCH_ALL 'Philosophy' AND content IS NULL)
AND SEARCH('title:ALL(Philosophy) OR content:ALL("Disney+ Hotstar")')
"""
@@ -147,7 +147,7 @@ suite("test_search_or_null_semantics") {
// Test 7: Complex nested query similar to original bug report
def test7 = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableName}
WHERE SEARCH('
title:ALL(Philosophy)
OR NOT (
@@ -177,23 +177,23 @@ suite("test_search_or_null_semantics") {
// Rows 17-20: no match -> NOT no_match = TRUE (included)
// Result: 4 rows
def test8_standard = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableName}
WHERE SEARCH('NOT (title:ALL(Philosophy) OR content:ALL("Disney+ Hotstar"))', '{"mode":"standard"}')
"""
assertEquals(0, test8_standard[0][0], "Standard mode: NOT OR should exclude all rows due to NULL semantics")
def test8_lucene = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableName}
WHERE SEARCH('NOT (title:ALL(Philosophy) OR content:ALL("Disney+ Hotstar"))')
"""
assertEquals(4, test8_lucene[0][0], "Lucene mode: NOT OR returns 4 rows (rows 17-20, no match treated as FALSE)")
logger.info("Test 8 PASSED: NOT OR with NULL works correctly in both modes")
// Test 9: Verify SEARCH works with and without pushdown
- sql "SET enable_common_expr_pushdown = false"
+ sql "SET enable_segment_limit_pushdown = false"
def test9 = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableName}
WHERE SEARCH('title:ALL(Philosophy) OR content:ALL("Disney+ Hotstar")')
"""
diff --git a/regression-test/suites/inverted_index_p0/test_single_column_multi_index.groovy b/regression-test/suites/inverted_index_p0/test_single_column_multi_index.groovy
index bacd6b3f6ce..35ebe2032b7 100644
--- a/regression-test/suites/inverted_index_p0/test_single_column_multi_index.groovy
+++ b/regression-test/suites/inverted_index_p0/test_single_column_multi_index.groovy
@@ -174,8 +174,7 @@ suite("test_single_column_multi_index", "nonConcurrent") {
// Function to run match queries with debug points
def runMatchQueries = { ->
- sql """ set enable_common_expr_pushdown = true; """
- sql """ set enable_common_expr_pushdown_for_inverted_index = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
GetDebugPoint().enableDebugPointForAllBEs("VMatchPredicate.execute")
try {
diff --git a/regression-test/suites/inverted_index_p0/test_single_column_multi_index1.groovy b/regression-test/suites/inverted_index_p0/test_single_column_multi_index1.groovy
index b07f168e1f6..fb508f266e7 100644
--- a/regression-test/suites/inverted_index_p0/test_single_column_multi_index1.groovy
+++ b/regression-test/suites/inverted_index_p0/test_single_column_multi_index1.groovy
@@ -86,8 +86,7 @@ suite("test_single_column_multi_index1", "p0") {
// Function to run match queries with debug points
def runMatchQueries = { ->
- sql """ set enable_common_expr_pushdown = true; """
- sql """ set enable_common_expr_pushdown_for_inverted_index = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
try {
qt_sql """ select /*+ SET_VAR(enable_match_without_inverted_index = true) */ count() from ${tableName} where (request = 'GET /images/hm_bg.jpg HTTP/1.0'); """
qt_sql """ select /*+ SET_VAR(enable_match_without_inverted_index = true) */ count() from ${tableName} where (request match 'images'); """
diff --git a/regression-test/suites/inverted_index_p0/test_stopwords.groovy b/regression-test/suites/inverted_index_p0/test_stopwords.groovy
index f9f8c8339a7..31e30cf6e48 100644
--- a/regression-test/suites/inverted_index_p0/test_stopwords.groovy
+++ b/regression-test/suites/inverted_index_p0/test_stopwords.groovy
@@ -42,7 +42,7 @@ suite("test_stopwords", "p0"){
try {
sql "sync"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql """ select * from ${indexTbName} where b match 'a'; """
qt_sql """ select * from ${indexTbName} where b match 'are'; """
diff --git a/regression-test/suites/inverted_index_p0/test_variant_subcolumn_index_norms.groovy b/regression-test/suites/inverted_index_p0/test_variant_subcolumn_index_norms.groovy
index 70e9c612808..8f36e872f36 100644
--- a/regression-test/suites/inverted_index_p0/test_variant_subcolumn_index_norms.groovy
+++ b/regression-test/suites/inverted_index_p0/test_variant_subcolumn_index_norms.groovy
@@ -28,7 +28,7 @@ suite("test_variant_subcolumn_index_norms", "p0,nonConcurrent") {
return
}
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = 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/topn_clear_block.groovy b/regression-test/suites/inverted_index_p0/topn_clear_block.groovy
index 78d541bcb4a..a9044f43087 100644
--- a/regression-test/suites/inverted_index_p0/topn_clear_block.groovy
+++ b/regression-test/suites/inverted_index_p0/topn_clear_block.groovy
@@ -40,7 +40,7 @@ suite("test_clear_block") {
}
sql """ set enable_match_without_inverted_index = false; """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
// sql """ set
def dupTableName = "dup_httplogs"
sql """ drop table if exists ${dupTableName} """
diff --git a/regression-test/suites/inverted_index_p0/unique_with_mow/test_mow_with_null_sequence.groovy b/regression-test/suites/inverted_index_p0/unique_with_mow/test_mow_with_null_sequence.groovy
index ef266e23432..e4b2c19cd25 100644
--- a/regression-test/suites/inverted_index_p0/unique_with_mow/test_mow_with_null_sequence.groovy
+++ b/regression-test/suites/inverted_index_p0/unique_with_mow/test_mow_with_null_sequence.groovy
@@ -38,7 +38,7 @@ suite("test_mow_with_null_sequence", "inverted_index") {
);
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ insert into $tableName values('a', 'zhang san', 'address1', NULL) """
sql """ insert into $tableName values('a', 'zhang si', 'address2', '2022-10-20') """
diff --git a/regression-test/suites/inverted_index_p0/unique_with_mow/test_pk_uk_case.groovy b/regression-test/suites/inverted_index_p0/unique_with_mow/test_pk_uk_case.groovy
index e433ccaa06b..3beb6684796 100644
--- a/regression-test/suites/inverted_index_p0/unique_with_mow/test_pk_uk_case.groovy
+++ b/regression-test/suites/inverted_index_p0/unique_with_mow/test_pk_uk_case.groovy
@@ -192,7 +192,7 @@ suite("test_pk_uk_case_unique_with_mow", "inverted_index") {
"""
sql "sync"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
// count(*)
def result0 = sql """ SELECT count(*) FROM ${tableNamePk}; """
diff --git a/regression-test/suites/inverted_index_p0/unique_with_mow/test_primary_key_simple_case.groovy b/regression-test/suites/inverted_index_p0/unique_with_mow/test_primary_key_simple_case.groovy
index 0c437e4fe1b..267180e2163 100644
--- a/regression-test/suites/inverted_index_p0/unique_with_mow/test_primary_key_simple_case.groovy
+++ b/regression-test/suites/inverted_index_p0/unique_with_mow/test_primary_key_simple_case.groovy
@@ -66,7 +66,7 @@ suite("test_primary_key_simple_case", "inverted_index") {
sql """ INSERT INTO ${tableName} VALUES
(5, '2017-10-01', 'Beijing', 10, 1, NULL, NULL, '2020-01-05', 1, 34, 20)
"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
def result = sql """ SELECT * FROM ${tableName} t ORDER BY user_id; """
assertTrue(result.size() == 5)
diff --git a/regression-test/suites/inverted_index_p0/unique_with_mow/test_unique_mow_sequence.groovy b/regression-test/suites/inverted_index_p0/unique_with_mow/test_unique_mow_sequence.groovy
index c2a8b673f04..921f3c36d0e 100644
--- a/regression-test/suites/inverted_index_p0/unique_with_mow/test_unique_mow_sequence.groovy
+++ b/regression-test/suites/inverted_index_p0/unique_with_mow/test_unique_mow_sequence.groovy
@@ -76,7 +76,7 @@ suite("test_unique_mow_sequence", "inverted_index") {
}
sql "sync"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
order_qt_sql "select * from $tableName where c_custkey < 6;"
diff --git a/regression-test/suites/inverted_index_p1/need_read_data/test_dup_table_inverted_index.groovy b/regression-test/suites/inverted_index_p1/need_read_data/test_dup_table_inverted_index.groovy
index 8b474788759..fb30bfac684 100644
--- a/regression-test/suites/inverted_index_p1/need_read_data/test_dup_table_inverted_index.groovy
+++ b/regression-test/suites/inverted_index_p1/need_read_data/test_dup_table_inverted_index.groovy
@@ -672,7 +672,7 @@ suite("test_dup_table_inverted_index", "p1") {
try {
sql """ set enable_match_without_inverted_index = true """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
def dupTableName = "dup_httplogs"
sql """ drop table if exists ${dupTableName} """
// create table
@@ -752,9 +752,9 @@ suite("test_dup_table_inverted_index", "p1") {
compare_result(dup_result5, dup_result6, all_dup_sql)
compare_result(dup_result3, dup_result6, all_dup_sql)
- def dup_result7 = execute_sql.call("enable_common_expr_pushdown_for_inverted_index", "true", all_dup_sql)
+ def dup_result7 = execute_sql.call("enable_segment_limit_pushdown", "true", all_dup_sql)
logger.info("dup_result7 is {}", dup_result7);
- def dup_result8 = execute_sql.call("enable_common_expr_pushdown_for_inverted_index", "false", all_dup_sql)
+ def dup_result8 = execute_sql.call("enable_segment_limit_pushdown", "false", all_dup_sql)
logger.info("dup_result8 is {}", dup_result8);
compare_result(dup_result7, dup_result8, all_dup_sql)
compare_result(dup_result3, dup_result8, all_dup_sql)
diff --git a/regression-test/suites/mysql_fulltext_array_contains/sql/basic_q01.sql b/regression-test/suites/mysql_fulltext_array_contains/sql/basic_q01.sql
index 70bee6b036f..b3ceb262123 100644
--- a/regression-test/suites/mysql_fulltext_array_contains/sql/basic_q01.sql
+++ b/regression-test/suites/mysql_fulltext_array_contains/sql/basic_q01.sql
@@ -1,27 +1,27 @@
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_uk_array WHERE array_contains(title, 'Database') OR array_contains(body, 'Database') ORDER BY id;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM articles_uk_array WHERE array_contains(title, 'database') OR array_contains(body, 'database');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_uk_array WHERE array_contains(title, 'Tutorial') OR array_contains(body, 'Tutorial') ORDER BY id;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_uk_array WHERE array_contains(title, 'MySQL') OR array_contains(body, 'MySQL') ORDER BY id;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_uk_array WHERE array_contains(title, 'Database') OR array_contains(body, 'Database') ORDER BY id;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM articles_uk_array WHERE array_contains(title, 'database') OR array_contains(body, 'database');
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_uk_array WHERE array_contains(title, 'Tutorial') OR array_contains(body, 'Tutorial') ORDER BY id;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_uk_array WHERE array_contains(title, 'MySQL') OR array_contains(body, 'MySQL') ORDER BY id;
-- NOT SUPPORT:
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(IF(array_contains(title, 'database') OR array_contains(body, 'database'), 1, NULL)) as count FROM articles_uk_array;
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(IF(array_contains(title, 'database') OR array_contains(body, 'database'), 1, NULL)) as count FROM articles_uk_array;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_uk_array WHERE (array_contains(title, 'MySQL') AND NOT array_contains(title, 'YourSQL'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_uk_array WHERE (array_contains(title, 'MySQL') AND NOT array_contains(title, 'YourSQL'))
OR (array_contains(body, 'MySQL') AND NOT array_contains(body, 'YourSQL')) ORDER BY id;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_uk_array WHERE array_contains(title, 'DBMS Security') OR array_contains(body, 'DBMS Security') ORDER BY id;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_uk_array WHERE array_contains(title, 'MySQL YourSQL') OR array_contains(body, 'MySQL YourSQL') ORDER BY id;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_uk_array WHERE array_contains(title, 'DBMS Security') OR array_contains(body, 'DBMS Security') ORDER BY id;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_uk_array WHERE array_contains(title, 'MySQL YourSQL') OR array_contains(body, 'MySQL YourSQL') ORDER BY id;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_uk_array WHERE (array_contains(title, 'MySQL') OR array_contains(body, 'MySQL'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_uk_array WHERE (array_contains(title, 'MySQL') OR array_contains(body, 'MySQL'))
AND NOT (array_contains(title, 'Well stands') OR array_contains(body, 'Well stands')) ORDER BY id;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_uk_array WHERE (array_contains(title, 'YourSQL') OR array_contains(body, 'YourSQL'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_uk_array WHERE (array_contains(title, 'YourSQL') OR array_contains(body, 'YourSQL'))
OR ((array_contains(title, 'MySQL') OR array_contains(body, 'MySQL'))
AND NOT (array_contains(title, 'Tricks Security') OR array_contains(body, 'Tricks Security'))) ORDER BY id;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_uk_array WHERE ((array_contains(title, 'MySQL') OR array_contains(body, 'MySQL'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_uk_array WHERE ((array_contains(title, 'MySQL') OR array_contains(body, 'MySQL'))
AND NOT (array_contains(title, 'Tricks Security') OR array_contains(body, 'Tricks Security')))
AND NOT (array_contains(title, 'YourSQL') OR array_contains(body, 'YourSQL')) ORDER BY id;
-- match phrase, NOT SUPPORT:
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_uk_array WHERE title MATCH_PHRASE 'following database' OR body MATCH_PHRASE 'following database';
\ No newline at end of file
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_uk_array WHERE title MATCH_PHRASE 'following database' OR body MATCH_PHRASE 'following database';
\ No newline at end of file
diff --git a/regression-test/suites/mysql_fulltext_array_contains/sql/basic_q02.sql b/regression-test/suites/mysql_fulltext_array_contains/sql/basic_q02.sql
index 558d2b9bf4d..8288554826a 100644
--- a/regression-test/suites/mysql_fulltext_array_contains/sql/basic_q02.sql
+++ b/regression-test/suites/mysql_fulltext_array_contains/sql/basic_q02.sql
@@ -1,27 +1,27 @@
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_dk_array WHERE array_contains(title, 'Database') OR array_contains(body, 'Database') ORDER BY id;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM articles_dk_array WHERE array_contains(title, 'database') OR array_contains(body, 'database');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_dk_array WHERE array_contains(title, 'Tutorial') OR array_contains(body, 'Tutorial') ORDER BY id;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_dk_array WHERE array_contains(title, 'MySQL') OR array_contains(body, 'MySQL') ORDER BY id;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_dk_array WHERE array_contains(title, 'Database') OR array_contains(body, 'Database') ORDER BY id;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM articles_dk_array WHERE array_contains(title, 'database') OR array_contains(body, 'database');
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_dk_array WHERE array_contains(title, 'Tutorial') OR array_contains(body, 'Tutorial') ORDER BY id;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_dk_array WHERE array_contains(title, 'MySQL') OR array_contains(body, 'MySQL') ORDER BY id;
-- NOT SUPPORT:
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(IF(array_contains(title, 'database') OR array_contains(body, 'database'), 1, NULL)) as count FROM articles_dk_array;
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(IF(array_contains(title, 'database') OR array_contains(body, 'database'), 1, NULL)) as count FROM articles_dk_array;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_dk_array WHERE (array_contains(title, 'MySQL') AND NOT array_contains(title, 'YourSQL'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_dk_array WHERE (array_contains(title, 'MySQL') AND NOT array_contains(title, 'YourSQL'))
OR (array_contains(body, 'MySQL') AND NOT array_contains(body, 'YourSQL')) ORDER BY id;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_dk_array WHERE array_contains(title, 'DBMS Security') OR array_contains(body, 'DBMS Security') ORDER BY id;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_dk_array WHERE array_contains(title, 'MySQL YourSQL') OR array_contains(body, 'MySQL YourSQL') ORDER BY id;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_dk_array WHERE array_contains(title, 'DBMS Security') OR array_contains(body, 'DBMS Security') ORDER BY id;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_dk_array WHERE array_contains(title, 'MySQL YourSQL') OR array_contains(body, 'MySQL YourSQL') ORDER BY id;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_dk_array WHERE (array_contains(title, 'MySQL') OR array_contains(body, 'MySQL'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_dk_array WHERE (array_contains(title, 'MySQL') OR array_contains(body, 'MySQL'))
AND NOT (array_contains(title, 'Well stands') OR array_contains(body, 'Well stands')) ORDER BY id;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_dk_array WHERE (array_contains(title, 'YourSQL') OR array_contains(body, 'YourSQL'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_dk_array WHERE (array_contains(title, 'YourSQL') OR array_contains(body, 'YourSQL'))
OR ((array_contains(title, 'MySQL') OR array_contains(body, 'MySQL'))
AND NOT (array_contains(title, 'Tricks Security') OR array_contains(body, 'Tricks Security'))) ORDER BY id;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_dk_array WHERE ((array_contains(title, 'MySQL') OR array_contains(body, 'MySQL'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_dk_array WHERE ((array_contains(title, 'MySQL') OR array_contains(body, 'MySQL'))
AND NOT (array_contains(title, 'Tricks Security') OR array_contains(body, 'Tricks Security')))
AND NOT (array_contains(title, 'YourSQL') OR array_contains(body, 'YourSQL')) ORDER BY id;
-- match phrase, NOT SUPPORT:
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM articles_dk_array WHERE title MATCH_PHRASE 'following database' OR body MATCH_PHRASE 'following database';
\ No newline at end of file
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM articles_dk_array WHERE title MATCH_PHRASE 'following database' OR body MATCH_PHRASE 'following database';
\ No newline at end of file
diff --git a/regression-test/suites/mysql_fulltext_array_contains/sql/fulltext_q01.sql b/regression-test/suites/mysql_fulltext_array_contains/sql/fulltext_q01.sql
index 79b75171f55..29ab0b9add2 100644
--- a/regression-test/suites/mysql_fulltext_array_contains/sql/fulltext_q01.sql
+++ b/regression-test/suites/mysql_fulltext_array_contains/sql/fulltext_q01.sql
@@ -1,40 +1,40 @@
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ANY 'collections' OR array_contains(b, 'collections') ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ANY 'indexes' OR array_contains(b, 'indexes') ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ANY 'indexes collections' OR array_contains(b, 'indexes collections') ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ANY 'only' OR array_contains(b, 'only') ORDER BY a;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ANY 'collections' OR array_contains(b, 'collections') ORDER BY a;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ANY 'indexes' OR array_contains(b, 'indexes') ORDER BY a;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ANY 'indexes collections' OR array_contains(b, 'indexes collections') ORDER BY a;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ANY 'only' OR array_contains(b, 'only') ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE (a MATCH_ANY 'support' OR array_contains(b, 'support'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE (a MATCH_ANY 'support' OR array_contains(b, 'support'))
AND NOT (a MATCH_ANY 'collections' OR array_contains(b, 'collections')) ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ANY 'support collections' OR array_contains(b, 'support collections') ORDER BY a;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ANY 'support collections' OR array_contains(b, 'support collections') ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE (a MATCH_ANY 'support collections' OR array_contains(b, 'support collections'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE (a MATCH_ANY 'support collections' OR array_contains(b, 'support collections'))
AND (a MATCH_ANY 'collections' OR array_contains(b, 'collections')) ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ALL 'support collections' OR array_contains(b, 'support collections') ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ANY 'search' OR array_contains(b, 'search') ORDER BY a;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ALL 'support collections' OR array_contains(b, 'support collections') ORDER BY a;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ANY 'search' OR array_contains(b, 'search') ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE (a MATCH_ANY 'search' OR array_contains(b, 'search'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE (a MATCH_ANY 'search' OR array_contains(b, 'search'))
AND (a MATCH_ANY 'support vector' OR array_contains(b, 'support vector')) ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE (a MATCH_ANY 'search' OR array_contains(b, 'search'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE (a MATCH_ANY 'search' OR array_contains(b, 'search'))
AND NOT (a MATCH_ANY 'support vector' OR array_contains(b, 'support vector')) ORDER BY a;
-- NOT SUPPORT:
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ *, (a MATCH_ANY 'support collections' OR array_contains(b, 'support collections')) AS x FROM fulltext_t1_uk;
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ *, (a MATCH_ANY 'collections support' OR array_contains(b, 'collections support')) AS x FROM fulltext_t1_uk;
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ *, (a MATCH_ANY 'support collections' OR array_contains(b, 'support collections')) AS x FROM fulltext_t1_uk;
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ *, (a MATCH_ANY 'collections support' OR array_contains(b, 'collections support')) AS x FROM fulltext_t1_uk;
-- match phrase, NOT SUPPORT:
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_PHRASE 'support now' OR b MATCH_PHRASE 'support now';
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_PHRASE 'Now sUPPort' OR b MATCH_PHRASE 'Now sUPPort';
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_PHRASE 'now support' OR b MATCH_PHRASE 'now support';
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_PHRASE 'support now' OR b MATCH_PHRASE 'support now';
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_PHRASE 'Now sUPPort' OR b MATCH_PHRASE 'Now sUPPort';
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_PHRASE 'now support' OR b MATCH_PHRASE 'now support';
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE (a MATCH_PHRASE 'text search' OR b MATCH_PHRASE 'text search')
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE (a MATCH_PHRASE 'text search' OR b MATCH_PHRASE 'text search')
-- OR (a MATCH_PHRASE 'now support' OR b MATCH_PHRASE 'now support');
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE (a MATCH_PHRASE 'text search' OR b MATCH_PHRASE 'text search')
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE (a MATCH_PHRASE 'text search' OR b MATCH_PHRASE 'text search')
-- AND NOT (a MATCH_PHRASE 'now support' OR b MATCH_PHRASE 'now support');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ANY '"space model' OR array_contains(b, '"space model') ORDER BY a;
\ No newline at end of file
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_uk_array WHERE a MATCH_ANY '"space model' OR array_contains(b, '"space model') ORDER BY a;
\ No newline at end of file
diff --git a/regression-test/suites/mysql_fulltext_array_contains/sql/fulltext_q02.sql b/regression-test/suites/mysql_fulltext_array_contains/sql/fulltext_q02.sql
index 04a52f77dae..3eebda6d21b 100644
--- a/regression-test/suites/mysql_fulltext_array_contains/sql/fulltext_q02.sql
+++ b/regression-test/suites/mysql_fulltext_array_contains/sql/fulltext_q02.sql
@@ -1,40 +1,40 @@
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ANY 'collections' OR array_contains(b, 'collections') ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ANY 'indexes' OR array_contains(b, 'indexes') ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ANY 'indexes collections' OR array_contains(b, 'indexes collections') ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ANY 'only' OR array_contains(b, 'only') ORDER BY a;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ANY 'collections' OR array_contains(b, 'collections') ORDER BY a;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ANY 'indexes' OR array_contains(b, 'indexes') ORDER BY a;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ANY 'indexes collections' OR array_contains(b, 'indexes collections') ORDER BY a;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ANY 'only' OR array_contains(b, 'only') ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE (a MATCH_ANY 'support' OR array_contains(b, 'support'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE (a MATCH_ANY 'support' OR array_contains(b, 'support'))
AND NOT (a MATCH_ANY 'collections' OR array_contains(b, 'collections')) ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ANY 'support collections' OR array_contains(b, 'support collections') ORDER BY a;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ANY 'support collections' OR array_contains(b, 'support collections') ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE (a MATCH_ANY 'support collections' OR array_contains(b, 'support collections'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE (a MATCH_ANY 'support collections' OR array_contains(b, 'support collections'))
AND (a MATCH_ANY 'collections' OR array_contains(b, 'collections')) ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ALL 'support collections' OR array_contains(b, 'support collections') ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ANY 'search' OR array_contains(b, 'search') ORDER BY a;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ALL 'support collections' OR array_contains(b, 'support collections') ORDER BY a;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ANY 'search' OR array_contains(b, 'search') ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE (a MATCH_ANY 'search' OR array_contains(b, 'search'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE (a MATCH_ANY 'search' OR array_contains(b, 'search'))
AND (a MATCH_ANY 'support vector' OR array_contains(b, 'support vector')) ORDER BY a;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE (a MATCH_ANY 'search' OR array_contains(b, 'search'))
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE (a MATCH_ANY 'search' OR array_contains(b, 'search'))
AND NOT (a MATCH_ANY 'support vector' OR array_contains(b, 'support vector')) ORDER BY a;
-- NOT SUPPORT:
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ *, (a MATCH_ANY 'support collections' OR array_contains(b, 'support collections')) AS x FROM fulltext_t1_dk;
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ *, (a MATCH_ANY 'collections support' OR array_contains(b, 'collections support')) AS x FROM fulltext_t1_dk;
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ *, (a MATCH_ANY 'support collections' OR array_contains(b, 'support collections')) AS x FROM fulltext_t1_dk;
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ *, (a MATCH_ANY 'collections support' OR array_contains(b, 'collections support')) AS x FROM fulltext_t1_dk;
-- match phrase, NOT SUPPORT:
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_PHRASE 'support now' OR b MATCH_PHRASE 'support now';
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_PHRASE 'Now sUPPort' OR b MATCH_PHRASE 'Now sUPPort';
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_PHRASE 'now support' OR b MATCH_PHRASE 'now support';
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_PHRASE 'support now' OR b MATCH_PHRASE 'support now';
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_PHRASE 'Now sUPPort' OR b MATCH_PHRASE 'Now sUPPort';
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_PHRASE 'now support' OR b MATCH_PHRASE 'now support';
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE (a MATCH_PHRASE 'text search' OR b MATCH_PHRASE 'text search')
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE (a MATCH_PHRASE 'text search' OR b MATCH_PHRASE 'text search')
-- OR (a MATCH_PHRASE 'now support' OR b MATCH_PHRASE 'now support');
--- SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE (a MATCH_PHRASE 'text search' OR b MATCH_PHRASE 'text search')
+-- SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE (a MATCH_PHRASE 'text search' OR b MATCH_PHRASE 'text search')
-- AND NOT (a MATCH_PHRASE 'now support' OR b MATCH_PHRASE 'now support');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ANY '"space model' OR array_contains(b, '"space model') ORDER BY a;
\ No newline at end of file
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ * FROM fulltext_t1_dk_array WHERE a MATCH_ANY '"space model' OR array_contains(b, '"space model') ORDER BY a;
\ No newline at end of file
diff --git a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q01.sql b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q01.sql
index e98a4853460..79823cef5f2 100644
--- a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q01.sql
+++ b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q01.sql
@@ -1,34 +1,34 @@
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_uk_array;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_uk_array;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ FTS_DOC_ID FROM large_records_t1_uk_array WHERE a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49') order by FTS_DOC_ID;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ FTS_DOC_ID FROM large_records_t1_uk_array WHERE a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49') order by FTS_DOC_ID;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_uk_array
WHERE (a MATCH_ANY 'row5col2word49' OR array_contains(b, 'row5col2word49'))
AND (a MATCH_ANY 'row5col1word49' OR array_contains(b, 'row5col1word49'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_uk_array
WHERE a MATCH_ANY 'row5col2word49' OR array_contains(b, 'row5col2word49');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_uk_array
WHERE (a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49'))
AND (a MATCH_ANY 'row35col1word49 row35col2word40' OR array_contains(b, 'row35col1word49 row35col2word40'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_uk_array
WHERE (a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49'))
AND NOT (a MATCH_ANY 'row45col2word49' OR array_contains(b, 'row45col2word49'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_uk_array
WHERE a MATCH_ANY 'row5col2word49' OR array_contains(b, 'row5col2word40');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_uk_array
WHERE a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_uk_array
WHERE a MATCH_ANY 'ROW35col2WORD49' OR array_contains(b, 'ROW35col2WORD49');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ a,b FROM large_records_t1_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ a,b FROM large_records_t1_uk_array
WHERE (a MATCH_ANY 'row5col2word49' OR array_contains(b, 'row5col2word49'))
AND (a MATCH_ANY 'row5col1word49' OR array_contains(b, 'row5col1word49')) ORDER BY FTS_DOC_ID;
diff --git a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q02.sql b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q02.sql
index 44606c49cfe..61d14df34e5 100644
--- a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q02.sql
+++ b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q02.sql
@@ -1,34 +1,34 @@
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_dk_array;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_dk_array;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ FTS_DOC_ID FROM large_records_t1_dk_array WHERE a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49') order by FTS_DOC_ID;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ FTS_DOC_ID FROM large_records_t1_dk_array WHERE a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49') order by FTS_DOC_ID;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_dk_array
WHERE (a MATCH_ANY 'row5col2word49' OR array_contains(b, 'row5col2word49'))
AND (a MATCH_ANY 'row5col1word49' OR array_contains(b, 'row5col1word49'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_dk_array
WHERE a MATCH_ANY 'row5col2word49' OR array_contains(b, 'row5col2word49');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_dk_array
WHERE (a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49'))
AND (a MATCH_ANY 'row35col1word49 row35col2word40' OR array_contains(b, 'row35col1word49 row35col2word40'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_dk_array
WHERE (a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49'))
AND NOT (a MATCH_ANY 'row45col2word49' OR array_contains(b, 'row45col2word49'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_dk_array
WHERE a MATCH_ANY 'row5col2word49' OR array_contains(b, 'row5col2word40');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_dk_array
WHERE a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t1_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t1_dk_array
WHERE a MATCH_ANY 'ROW35col2WORD49' OR array_contains(b, 'ROW35col2WORD49');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ a,b FROM large_records_t1_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ a,b FROM large_records_t1_dk_array
WHERE (a MATCH_ANY 'row5col2word49' OR array_contains(b, 'row5col2word49'))
AND (a MATCH_ANY 'row5col1word49' OR array_contains(b, 'row5col1word49')) ORDER BY FTS_DOC_ID;
diff --git a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q03.sql b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q03.sql
index 21cf33e32ec..fcb5ac3a61a 100644
--- a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q03.sql
+++ b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q03.sql
@@ -1,28 +1,28 @@
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t2_uk_array;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t2_uk_array;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ FTS_DOC_ID FROM large_records_t2_uk_array WHERE array_contains(b, 'row30col2word30');
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ FTS_DOC_ID FROM large_records_t2_uk_array WHERE array_contains(b, 'row30col2word30');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ FTS_DOC_ID FROM large_records_t2_uk_array WHERE a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49');
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ FTS_DOC_ID FROM large_records_t2_uk_array WHERE a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t2_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t2_uk_array
WHERE (a MATCH_ANY 'row5col2word49' OR array_contains(b, 'row5col2word49'))
AND (a MATCH_ANY 'row5col1word49' OR array_contains(b, 'row5col1word49'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t2_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t2_uk_array
WHERE (a MATCH_ANY 'row5col2word49' OR array_contains(b, 'row5col2word49'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t2_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t2_uk_array
WHERE (a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49'))
AND (a MATCH_ANY 'row35col1word49 row35col2word40' OR array_contains(b, 'row35col1word49 row35col2word40'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t2_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t2_uk_array
WHERE (a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49'))
AND NOT (a MATCH_ANY 'row45col2word49' OR array_contains(b, 'row45col2word49'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t2_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t2_uk_array
WHERE a MATCH_ANY 'row5col2word49 row5col2word40' OR array_contains(b, 'row5col2word49 row5col2word40');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t2_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t2_uk_array
WHERE a MATCH_ALL 'ROW35col2WORD49' OR array_contains(b, 'ROW35col2WORD49');
\ No newline at end of file
diff --git a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q04.sql b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q04.sql
index 07ed01e8214..596282d768a 100644
--- a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q04.sql
+++ b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q04.sql
@@ -1,28 +1,28 @@
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t2_dk_array;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t2_dk_array;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ FTS_DOC_ID FROM large_records_t2_dk_array WHERE array_contains(b, 'row30col2word30');
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ FTS_DOC_ID FROM large_records_t2_dk_array WHERE array_contains(b, 'row30col2word30');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ FTS_DOC_ID FROM large_records_t2_dk_array WHERE a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49');
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ FTS_DOC_ID FROM large_records_t2_dk_array WHERE a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t2_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t2_dk_array
WHERE (a MATCH_ANY 'row5col2word49' OR array_contains(b, 'row5col2word49'))
AND (a MATCH_ANY 'row5col1word49' OR array_contains(b, 'row5col1word49'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t2_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t2_dk_array
WHERE (a MATCH_ANY 'row5col2word49' OR array_contains(b, 'row5col2word49'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t2_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t2_dk_array
WHERE (a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49'))
AND (a MATCH_ANY 'row35col1word49 row35col2word40' OR array_contains(b, 'row35col1word49 row35col2word40'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t2_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t2_dk_array
WHERE (a MATCH_ANY 'row35col2word49' OR array_contains(b, 'row35col2word49'))
AND NOT (a MATCH_ANY 'row45col2word49' OR array_contains(b, 'row45col2word49'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t2_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t2_dk_array
WHERE a MATCH_ANY 'row5col2word49 row5col2word40' OR array_contains(b, 'row5col2word49 row5col2word40');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t2_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t2_dk_array
WHERE a MATCH_ALL 'ROW35col2WORD49' OR array_contains(b, 'ROW35col2WORD49');
\ No newline at end of file
diff --git a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q05.sql b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q05.sql
index 0f8c868354f..9f1cba9c722 100644
--- a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q05.sql
+++ b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q05.sql
@@ -1,18 +1,18 @@
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t3_uk_array;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t3_uk_array;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t3_uk_array WHERE array_contains(b, 'samerowword');
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t3_uk_array WHERE array_contains(b, 'samerowword');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t3_uk_array WHERE a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword');
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t3_uk_array WHERE a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t3_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t3_uk_array
WHERE (a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword'))
AND (a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t3_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t3_uk_array
WHERE (a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword'))
AND NOT (a MATCH_ANY 'row45col2word49' OR array_contains(b, 'row45col2word49'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t3_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t3_uk_array
WHERE (a MATCH_ANY 'sameroww' OR array_contains(b, 'sameroww'));
\ No newline at end of file
diff --git a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q06.sql b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q06.sql
index e90491cd3b0..3702a552560 100644
--- a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q06.sql
+++ b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q06.sql
@@ -1,18 +1,18 @@
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t3_dk_array;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t3_dk_array;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t3_dk_array WHERE array_contains(b, 'samerowword');
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t3_dk_array WHERE array_contains(b, 'samerowword');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t3_dk_array WHERE a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword');
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t3_dk_array WHERE a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t3_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t3_dk_array
WHERE (a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword'))
AND (a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t3_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t3_dk_array
WHERE (a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword'))
AND NOT (a MATCH_ANY 'row45col2word49' OR array_contains(b, 'row45col2word49'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t3_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t3_dk_array
WHERE (a MATCH_ANY 'sameroww' OR array_contains(b, 'sameroww'));
\ No newline at end of file
diff --git a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q07.sql b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q07.sql
index 493eb09405d..149ebcd792b 100644
--- a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q07.sql
+++ b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q07.sql
@@ -1,17 +1,17 @@
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t4_uk_array;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t4_uk_array;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t4_uk_array WHERE array_contains(b, 'samerowword');
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t4_uk_array WHERE array_contains(b, 'samerowword');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t4_uk_array WHERE a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword');
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t4_uk_array WHERE a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t4_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t4_uk_array
WHERE (a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword'))
AND (a MATCH_ANY '1050' OR array_contains(b, '1050'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t4_uk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t4_uk_array
WHERE (a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword'))
AND NOT (a MATCH_ANY '1050' OR array_contains(b, '1050'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t4_uk_array WHERE a MATCH_ANY '2001' OR array_contains(b, '2001');
\ No newline at end of file
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t4_uk_array WHERE a MATCH_ANY '2001' OR array_contains(b, '2001');
\ No newline at end of file
diff --git a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q08.sql b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q08.sql
index 94c8de66003..375d6940abc 100644
--- a/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q08.sql
+++ b/regression-test/suites/mysql_fulltext_array_contains/sql/large_records_q08.sql
@@ -1,17 +1,17 @@
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t4_dk_array;
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t4_dk_array;
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t4_dk_array WHERE array_contains(b, 'samerowword');
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t4_dk_array WHERE array_contains(b, 'samerowword');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t4_dk_array WHERE a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword');
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t4_dk_array WHERE a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword');
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t4_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t4_dk_array
WHERE (a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword'))
AND (a MATCH_ANY '1050' OR array_contains(b, '1050'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t4_dk_array
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t4_dk_array
WHERE (a MATCH_ANY 'samerowword' OR array_contains(b, 'samerowword'))
AND NOT (a MATCH_ANY '1050' OR array_contains(b, '1050'));
-SELECT/*+SET_VAR(enable_common_expr_pushdown=true,enable_common_expr_pushdown_for_inverted_index=true)*/ COUNT(*) FROM large_records_t4_dk_array WHERE a MATCH_ANY '2001' OR array_contains(b, '2001');
\ No newline at end of file
+SELECT/*+SET_VAR(enable_segment_limit_pushdown=true)*/ COUNT(*) FROM large_records_t4_dk_array WHERE a MATCH_ANY '2001' OR array_contains(b, '2001');
\ No newline at end of file
diff --git a/regression-test/suites/nereids_rules_p0/mv/variant/variant_mv.groovy b/regression-test/suites/nereids_rules_p0/mv/variant/variant_mv.groovy
index 092a48122c2..80496648e8c 100644
--- a/regression-test/suites/nereids_rules_p0/mv/variant/variant_mv.groovy
+++ b/regression-test/suites/nereids_rules_p0/mv/variant/variant_mv.groovy
@@ -584,7 +584,7 @@ suite("variant_mv") {
where g2.actor['id'] > 34259289;
"""
def query3_6 = """
- SELECT /*+SET_VAR(batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=false,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=0,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=true,parallel_scan_max_scanners_count=32,parallel_scan_min_rows_per_scanner=64,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_filter_type=1,enable_parallel_result_sink=false,enable_nereids_planner=true,rewrite_or_to [...]
+ SELECT /*+SET_VAR(batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=false,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=0,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=true,parallel_scan_max_scanners_count=32,parallel_scan_min_rows_per_scanner=64,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_filter_type=1,enable_parallel_result_sink=false,enable_nereids_planner=true,rewrite_or_to [...]
g1.id,
g2.type,
floor(cast(g1.actor['id'] as int) + 100.5),
diff --git a/regression-test/suites/query_p0/expr_zonemap/test_expr_zonemap_pruning.groovy b/regression-test/suites/query_p0/expr_zonemap/test_expr_zonemap_pruning.groovy
index 17959eab66d..7c468a0d1bf 100644
--- a/regression-test/suites/query_p0/expr_zonemap/test_expr_zonemap_pruning.groovy
+++ b/regression-test/suites/query_p0/expr_zonemap/test_expr_zonemap_pruning.groovy
@@ -21,7 +21,7 @@ import org.apache.doris.regression.action.ProfileAction
suite("test_expr_zonemap_pruning") {
sql """ set enable_expr_zonemap_filter = true """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ set enable_profile = true """
sql """ set profile_level = 2 """
diff --git a/regression-test/suites/query_p0/join/test_agg_after_nested_loop_join_local_exchange.groovy b/regression-test/suites/query_p0/join/test_agg_after_nested_loop_join_local_exchange.groovy
index 91889b319c8..c8902b37525 100644
--- a/regression-test/suites/query_p0/join/test_agg_after_nested_loop_join_local_exchange.groovy
+++ b/regression-test/suites/query_p0/join/test_agg_after_nested_loop_join_local_exchange.groovy
@@ -83,8 +83,7 @@ suite("test_agg_after_nested_loop_join_local_exchange", "query_p0") {
sql "SET default_variant_sparse_hash_shard_count = 4"
sql "SET disable_join_reorder = true"
sql "SET disable_streaming_preaggregations = true"
- sql "SET enable_common_expr_pushdown = false"
- sql "SET enable_common_expr_pushdown_for_inverted_index = false"
+ sql "SET enable_segment_limit_pushdown = false"
sql "SET enable_distinct_streaming_agg_force_passthrough = false"
sql "SET enable_function_pushdown = true"
sql "SET enable_local_exchange_before_agg = false"
diff --git a/regression-test/suites/query_p0/limit/test_general_limit_pushdown.groovy b/regression-test/suites/query_p0/limit/test_general_limit_pushdown.groovy
new file mode 100644
index 00000000000..eb2c37d5337
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/test_general_limit_pushdown.groovy
@@ -0,0 +1,287 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Test general limit pushdown to storage layer for DUP_KEYS and UNIQUE_KEYS (MOW).
+// This exercises the non-topn limit path where SegmentIterator applies
+// general_read_limit after pushed filters and before lazy materialization.
+
+suite("test_general_limit_pushdown") {
+
+ // ---- DUP_KEYS table ----
+ sql "DROP TABLE IF EXISTS dup_limit_pushdown"
+ sql """
+ CREATE TABLE dup_limit_pushdown (
+ k1 INT NOT NULL,
+ k2 INT NOT NULL,
+ v1 VARCHAR(100) NULL
+ )
+ DUPLICATE KEY(k1, k2)
+ DISTRIBUTED BY HASH(k1) BUCKETS 1
+ PROPERTIES ("replication_num" = "1");
+ """
+
+ // Insert 50 rows: k1 in [1..50], k2 = 100 - k1, v1 = 'val_<k1>'
+ StringBuilder sb = new StringBuilder()
+ sb.append("INSERT INTO dup_limit_pushdown VALUES ")
+ for (int i = 1; i <= 50; i++) {
+ if (i > 1) sb.append(",")
+ sb.append("(${i}, ${100 - i}, 'val_${i}')")
+ }
+ sql sb.toString()
+
+ // Basic LIMIT without ORDER BY — exercises general limit pushdown path.
+ // Use order_qt_ to ensure deterministic output ordering.
+ order_qt_dup_basic_limit """
+ SELECT k1, k2 FROM dup_limit_pushdown LIMIT 10
+ """
+
+ // LIMIT with WHERE clause -- pushed filters must be applied before limit
+ // counting, otherwise we may get fewer rows than requested.
+ // k1 > 10 matches 40 rows, LIMIT 15 should return exactly 15.
+ order_qt_dup_filter_limit """
+ SELECT k1, k2 FROM dup_limit_pushdown WHERE k1 > 10 LIMIT 15
+ """
+
+ // LIMIT larger than matching rows — should return all matching rows.
+ // k1 > 45 matches 5 rows, LIMIT 20 should return all 5.
+ order_qt_dup_filter_over_limit """
+ SELECT k1, k2 FROM dup_limit_pushdown WHERE k1 > 45 LIMIT 20
+ """
+
+ // LIMIT with complex predicate (function-based, may not push into storage predicates).
+ // This exercises the SegmentIterator common-expr path for predicates that remain as conjuncts.
+ order_qt_dup_complex_filter_limit """
+ SELECT k1, k2 FROM dup_limit_pushdown WHERE abs(k1 - 25) < 10 LIMIT 8
+ """
+
+ // ---- UNIQUE_KEYS with MOW table ----
+ sql "DROP TABLE IF EXISTS mow_limit_pushdown"
+ sql """
+ CREATE TABLE mow_limit_pushdown (
+ k1 INT NOT NULL,
+ k2 INT NOT NULL,
+ v1 VARCHAR(100) NULL
+ )
+ UNIQUE KEY(k1, k2)
+ DISTRIBUTED BY HASH(k1) BUCKETS 1
+ PROPERTIES (
+ "replication_num" = "1",
+ "enable_unique_key_merge_on_write" = "true"
+ );
+ """
+
+ sb = new StringBuilder()
+ sb.append("INSERT INTO mow_limit_pushdown VALUES ")
+ for (int i = 1; i <= 50; i++) {
+ if (i > 1) sb.append(",")
+ sb.append("(${i}, ${100 - i}, 'val_${i}')")
+ }
+ sql sb.toString()
+
+ // Basic LIMIT without ORDER BY on MOW table.
+ order_qt_mow_basic_limit """
+ SELECT k1, k2 FROM mow_limit_pushdown LIMIT 10
+ """
+
+ // LIMIT with WHERE on MOW table.
+ order_qt_mow_filter_limit """
+ SELECT k1, k2 FROM mow_limit_pushdown WHERE k1 > 10 LIMIT 15
+ """
+
+ // LIMIT with complex predicate on MOW table.
+ order_qt_mow_complex_filter_limit """
+ SELECT k1, k2 FROM mow_limit_pushdown WHERE abs(k1 - 25) < 10 LIMIT 8
+ """
+
+ // ---- Verify row count correctness with COUNT ----
+ // These verify the LIMIT returns the expected number of rows,
+ // protecting against the pre-filter counting bug.
+
+ def dup_count = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1 FROM dup_limit_pushdown WHERE k1 > 10 LIMIT 15
+ ) t
+ """
+ assert dup_count[0][0] == 15 : "DUP_KEYS: expected 15 rows with WHERE k1>10 LIMIT 15, got ${dup_count[0][0]}"
+
+ def mow_count = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1 FROM mow_limit_pushdown WHERE k1 > 10 LIMIT 15
+ ) t
+ """
+ assert mow_count[0][0] == 15 : "MOW: expected 15 rows with WHERE k1>10 LIMIT 15, got ${mow_count[0][0]}"
+
+ // With complex predicate (abs(k1-25) < 10 => k1 in 16..34, 19 rows; LIMIT 8 should return 8)
+ def dup_complex_count = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1 FROM dup_limit_pushdown WHERE abs(k1 - 25) < 10 LIMIT 8
+ ) t
+ """
+ assert dup_complex_count[0][0] == 8 : "DUP_KEYS complex filter: expected 8 rows, got ${dup_complex_count[0][0]}"
+
+ // ---- AGG_KEYS table (negative test: optimization must NOT apply) ----
+ sql "DROP TABLE IF EXISTS agg_limit_pushdown"
+ sql """
+ CREATE TABLE agg_limit_pushdown (
+ k1 INT NOT NULL,
+ k2 INT NOT NULL,
+ v1 INT SUM NOT NULL
+ )
+ AGGREGATE KEY(k1, k2)
+ DISTRIBUTED BY HASH(k1) BUCKETS 1
+ PROPERTIES ("replication_num" = "1");
+ """
+ // Insert duplicate keys so aggregation is required
+ sql "INSERT INTO agg_limit_pushdown VALUES (1, 1, 10), (1, 1, 20), (2, 2, 30), (2, 2, 40), (3, 3, 50)"
+ // After aggregation: (1,1,30), (2,2,70), (3,3,50)
+ def agg_count = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2, v1 FROM agg_limit_pushdown LIMIT 2
+ ) t
+ """
+ assert agg_count[0][0] == 2 : "AGG_KEYS: expected 2 rows, got ${agg_count[0][0]}"
+ order_qt_agg_basic_limit """
+ SELECT k1, k2, v1 FROM agg_limit_pushdown LIMIT 2
+ """
+
+ // ---- MOR UNIQUE_KEYS table (negative test: optimization must NOT apply) ----
+ sql "DROP TABLE IF EXISTS mor_limit_pushdown"
+ sql """
+ CREATE TABLE mor_limit_pushdown (
+ k1 INT NOT NULL,
+ k2 INT NOT NULL,
+ v1 VARCHAR(100) NULL
+ )
+ UNIQUE KEY(k1, k2)
+ DISTRIBUTED BY HASH(k1) BUCKETS 1
+ PROPERTIES (
+ "replication_num" = "1",
+ "enable_unique_key_merge_on_write" = "false"
+ );
+ """
+ sb = new StringBuilder()
+ sb.append("INSERT INTO mor_limit_pushdown VALUES ")
+ for (int i = 1; i <= 30; i++) {
+ if (i > 1) sb.append(",")
+ sb.append("(${i}, ${100 - i}, 'val_${i}')")
+ }
+ sql sb.toString()
+ def mor_count = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM mor_limit_pushdown WHERE k1 > 10 LIMIT 10
+ ) t
+ """
+ assert mor_count[0][0] == 10 : "MOR UNIQUE_KEYS: expected 10 rows, got ${mor_count[0][0]}"
+ order_qt_mor_filter_limit """
+ SELECT k1, k2 FROM mor_limit_pushdown WHERE k1 > 10 LIMIT 10
+ """
+
+ // ---- MOW with DELETEs ----
+ // Verify __DORIS_DELETE_SIGN__ predicate (in _conjuncts) is correctly
+ // handled after being pushed into SegmentIterator.
+ sql "DROP TABLE IF EXISTS mow_delete_limit_pushdown"
+ sql """
+ CREATE TABLE mow_delete_limit_pushdown (
+ k1 INT NOT NULL,
+ k2 INT NOT NULL,
+ v1 VARCHAR(100) NULL
+ )
+ UNIQUE KEY(k1, k2)
+ DISTRIBUTED BY HASH(k1) BUCKETS 1
+ PROPERTIES (
+ "replication_num" = "1",
+ "enable_unique_key_merge_on_write" = "true"
+ );
+ """
+ sb = new StringBuilder()
+ sb.append("INSERT INTO mow_delete_limit_pushdown VALUES ")
+ for (int i = 1; i <= 50; i++) {
+ if (i > 1) sb.append(",")
+ sb.append("(${i}, ${100 - i}, 'val_${i}')")
+ }
+ sql sb.toString()
+ // Delete rows where k1 <= 20, leaving 30 rows (k1 in 21..50)
+ sql "DELETE FROM mow_delete_limit_pushdown WHERE k1 <= 20"
+ def mow_del_count = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM mow_delete_limit_pushdown LIMIT 15
+ ) t
+ """
+ assert mow_del_count[0][0] == 15 : "MOW with deletes: expected 15 rows, got ${mow_del_count[0][0]}"
+ order_qt_mow_delete_limit """
+ SELECT k1, k2 FROM mow_delete_limit_pushdown LIMIT 15
+ """
+ // With filter + delete: k1 > 30 matches 20 rows (31..50), LIMIT 10
+ def mow_del_filter_count = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM mow_delete_limit_pushdown WHERE k1 > 30 LIMIT 10
+ ) t
+ """
+ assert mow_del_filter_count[0][0] == 10 : "MOW delete+filter: expected 10 rows, got ${mow_del_filter_count[0][0]}"
+
+ // ---- Multiple buckets/tablets ----
+ // Exercises per-scanner limit vs global limit coordination with multiple scanners.
+ sql "DROP TABLE IF EXISTS dup_multi_bucket_limit"
+ sql """
+ CREATE TABLE dup_multi_bucket_limit (
+ k1 INT NOT NULL,
+ k2 INT NOT NULL,
+ v1 VARCHAR(100) NULL
+ )
+ DUPLICATE KEY(k1, k2)
+ DISTRIBUTED BY HASH(k1) BUCKETS 8
+ PROPERTIES ("replication_num" = "1");
+ """
+ sb = new StringBuilder()
+ sb.append("INSERT INTO dup_multi_bucket_limit VALUES ")
+ for (int i = 1; i <= 200; i++) {
+ if (i > 1) sb.append(",")
+ sb.append("(${i}, ${1000 - i}, 'val_${i}')")
+ }
+ sql sb.toString()
+ def multi_count = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM dup_multi_bucket_limit LIMIT 20
+ ) t
+ """
+ assert multi_count[0][0] == 20 : "Multi-bucket: expected 20 rows, got ${multi_count[0][0]}"
+ def multi_filter_count = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM dup_multi_bucket_limit WHERE k1 > 100 LIMIT 15
+ ) t
+ """
+ assert multi_filter_count[0][0] == 15 : "Multi-bucket filter: expected 15 rows, got ${multi_filter_count[0][0]}"
+
+ // ---- LIMIT + OFFSET ----
+ // Verify OFFSET interacts correctly with general limit pushdown.
+ def offset_count = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM dup_limit_pushdown LIMIT 10 OFFSET 5
+ ) t
+ """
+ assert offset_count[0][0] == 10 : "LIMIT+OFFSET: expected 10 rows, got ${offset_count[0][0]}"
+ order_qt_dup_limit_offset """
+ SELECT k1, k2 FROM dup_limit_pushdown LIMIT 10 OFFSET 5
+ """
+ // OFFSET beyond matching rows: k1 > 45 matches 5 rows, OFFSET 3 LIMIT 10 should return 2
+ def offset_over_count = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM dup_limit_pushdown WHERE k1 > 45 LIMIT 10 OFFSET 3
+ ) t
+ """
+ assert offset_over_count[0][0] == 2 : "LIMIT+OFFSET over: expected 2 rows, got ${offset_over_count[0][0]}"
+}
diff --git a/regression-test/suites/query_p0/limit/test_unified_limit_pushdown.groovy b/regression-test/suites/query_p0/limit/test_unified_limit_pushdown.groovy
new file mode 100644
index 00000000000..69fedf42b0f
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/test_unified_limit_pushdown.groovy
@@ -0,0 +1,233 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Test unified limit pushdown to SegmentIterator.
+// This exercises the code path where _can_opt_limit_reads() returns true
+// because all column predicates are evaluated by inverted index, allowing
+// the segment iterator to tighten nrows_read_limit and avoid reading
+// non-predicate columns past the pushed-down local read limit.
+
+suite("test_unified_limit_pushdown") {
+
+ // ---- DUP_KEYS table with inverted indexes ----
+ // Inverted indexes on all queried columns allow _can_opt_limit_reads()
+ // to return true, enabling the SegmentIterator limit optimization.
+ sql "DROP TABLE IF EXISTS dup_inv_limit"
+ sql """
+ CREATE TABLE dup_inv_limit (
+ k1 INT NOT NULL,
+ k2 INT NOT NULL,
+ v1 VARCHAR(100) NULL,
+ INDEX idx_k1 (k1) USING INVERTED,
+ INDEX idx_k2 (k2) USING INVERTED,
+ INDEX idx_v1 (v1) USING INVERTED
+ )
+ DUPLICATE KEY(k1, k2)
+ DISTRIBUTED BY HASH(k1) BUCKETS 1
+ PROPERTIES ("replication_num" = "1");
+ """
+
+ // Insert 200 rows for sufficient data volume
+ StringBuilder sb = new StringBuilder()
+ sb.append("INSERT INTO dup_inv_limit VALUES ")
+ for (int i = 1; i <= 200; i++) {
+ if (i > 1) sb.append(",")
+ sb.append("(${i}, ${1000 - i}, 'val_${i}')")
+ }
+ sql sb.toString()
+
+ // Basic LIMIT — general_read_limit path with inverted index optimization.
+ def count1 = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM dup_inv_limit LIMIT 10
+ ) t
+ """
+ assert count1[0][0] == 10 : "DUP inverted: basic LIMIT 10, got ${count1[0][0]}"
+
+ // LIMIT with WHERE predicate covered by inverted index.
+ // k1 > 100 matches 100 rows, LIMIT 15 should return exactly 15.
+ def count2 = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM dup_inv_limit WHERE k1 > 100 LIMIT 15
+ ) t
+ """
+ assert count2[0][0] == 15 : "DUP inverted: WHERE k1>100 LIMIT 15, got ${count2[0][0]}"
+
+ // LIMIT with multiple predicates on indexed columns.
+ // k1 > 50 AND k2 < 980 → k1 in [51..200] AND k2 < 980 → k2=1000-k1 < 980 → k1 > 20
+ // intersection: k1 in [51..200], all 150 rows match. LIMIT 30.
+ def count3 = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2, v1 FROM dup_inv_limit WHERE k1 > 50 AND k2 < 980 LIMIT 30
+ ) t
+ """
+ assert count3[0][0] == 30 : "DUP inverted: multi-pred LIMIT 30, got ${count3[0][0]}"
+
+ // LIMIT larger than matching rows — should return all matching rows.
+ // k1 > 195 matches 5 rows, LIMIT 20 should return all 5.
+ def count4 = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM dup_inv_limit WHERE k1 > 195 LIMIT 20
+ ) t
+ """
+ assert count4[0][0] == 5 : "DUP inverted: LIMIT > matching, got ${count4[0][0]}"
+
+ // ---- MOW UNIQUE_KEYS with inverted indexes ----
+ sql "DROP TABLE IF EXISTS mow_inv_limit"
+ sql """
+ CREATE TABLE mow_inv_limit (
+ k1 INT NOT NULL,
+ k2 INT NOT NULL,
+ v1 VARCHAR(100) NULL,
+ INDEX idx_k1 (k1) USING INVERTED,
+ INDEX idx_k2 (k2) USING INVERTED
+ )
+ UNIQUE KEY(k1, k2)
+ DISTRIBUTED BY HASH(k1) BUCKETS 1
+ PROPERTIES (
+ "replication_num" = "1",
+ "enable_unique_key_merge_on_write" = "true"
+ );
+ """
+ sb = new StringBuilder()
+ sb.append("INSERT INTO mow_inv_limit VALUES ")
+ for (int i = 1; i <= 200; i++) {
+ if (i > 1) sb.append(",")
+ sb.append("(${i}, ${1000 - i}, 'val_${i}')")
+ }
+ sql sb.toString()
+
+ def count5 = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM mow_inv_limit WHERE k1 > 100 LIMIT 20
+ ) t
+ """
+ assert count5[0][0] == 20 : "MOW inverted: WHERE k1>100 LIMIT 20, got ${count5[0][0]}"
+
+ // MOW with DELETEs + inverted index
+ sql "DELETE FROM mow_inv_limit WHERE k1 <= 50"
+ def count6 = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM mow_inv_limit LIMIT 25
+ ) t
+ """
+ assert count6[0][0] == 25 : "MOW inverted after delete: LIMIT 25, got ${count6[0][0]}"
+
+ def count7 = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM mow_inv_limit WHERE k1 > 150 LIMIT 10
+ ) t
+ """
+ assert count7[0][0] == 10 : "MOW inverted delete+filter: LIMIT 10, got ${count7[0][0]}"
+
+ // ---- Multi-bucket table with inverted indexes ----
+ // Tests scanner-level shared limit coordination across multiple scanners.
+ sql "DROP TABLE IF EXISTS dup_multi_inv_limit"
+ sql """
+ CREATE TABLE dup_multi_inv_limit (
+ k1 INT NOT NULL,
+ k2 INT NOT NULL,
+ v1 VARCHAR(100) NULL,
+ INDEX idx_k1 (k1) USING INVERTED,
+ INDEX idx_k2 (k2) USING INVERTED
+ )
+ DUPLICATE KEY(k1, k2)
+ DISTRIBUTED BY HASH(k1) BUCKETS 8
+ PROPERTIES ("replication_num" = "1");
+ """
+ sb = new StringBuilder()
+ sb.append("INSERT INTO dup_multi_inv_limit VALUES ")
+ for (int i = 1; i <= 500; i++) {
+ if (i > 1) sb.append(",")
+ sb.append("(${i}, ${10000 - i}, 'val_${i}')")
+ }
+ sql sb.toString()
+
+ // With 8 buckets, up to 8 scanners may run. The scanner-level shared limit coordinates
+ // to return exactly LIMIT rows.
+ def count8 = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM dup_multi_inv_limit LIMIT 20
+ ) t
+ """
+ assert count8[0][0] == 20 : "Multi-bucket inverted: LIMIT 20, got ${count8[0][0]}"
+
+ def count9 = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM dup_multi_inv_limit WHERE k1 > 200 LIMIT 50
+ ) t
+ """
+ assert count9[0][0] == 50 : "Multi-bucket inverted filter: LIMIT 50, got ${count9[0][0]}"
+
+ // Small limit with many buckets — tests that each scanner correctly
+ // respects the shared limit even when some scanners have no data.
+ def count10 = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM dup_multi_inv_limit LIMIT 3
+ ) t
+ """
+ assert count10[0][0] == 3 : "Multi-bucket inverted: LIMIT 3, got ${count10[0][0]}"
+
+ // ---- ORDER BY key LIMIT with inverted index (topn path) ----
+ // Tests that the topn_limit path also benefits from inverted index
+ // optimization in SegmentIterator. Use order_qt_* to validate the
+ // actual ordered rows, not just cardinality, so the optimization
+ // cannot silently return a wrong subset of the right size.
+ order_qt_topn_asc """
+ SELECT k1, k2 FROM dup_inv_limit ORDER BY k1 LIMIT 10
+ """
+
+ order_qt_topn_desc_filter """
+ SELECT k1, k2 FROM dup_inv_limit WHERE k1 > 100 ORDER BY k1 DESC LIMIT 15
+ """
+
+ // Also assert ORDER BY content for the multi-bucket case so that the
+ // multi-bucket path is row-validated, not just count-validated.
+ order_qt_topn_multi_bucket """
+ SELECT k1, k2 FROM dup_multi_inv_limit ORDER BY k1 LIMIT 12
+ """
+
+ def count11 = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM dup_inv_limit ORDER BY k1 LIMIT 10
+ ) t
+ """
+ assert count11[0][0] == 10 : "DUP inverted ORDER BY LIMIT: got ${count11[0][0]}"
+
+ def count12 = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM dup_inv_limit WHERE k1 > 100 ORDER BY k1 DESC LIMIT 15
+ ) t
+ """
+ assert count12[0][0] == 15 : "DUP inverted ORDER BY DESC with filter: got ${count12[0][0]}"
+
+ // ---- LIMIT + OFFSET with inverted index ----
+ def count13 = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM dup_inv_limit LIMIT 10 OFFSET 5
+ ) t
+ """
+ assert count13[0][0] == 10 : "DUP inverted LIMIT+OFFSET: got ${count13[0][0]}"
+
+ // OFFSET near end: k1 > 195 matches 5 rows, OFFSET 2 LIMIT 10 should return 3
+ def count14 = sql """
+ SELECT COUNT(*) FROM (
+ SELECT k1, k2 FROM dup_inv_limit WHERE k1 > 195 LIMIT 10 OFFSET 2
+ ) t
+ """
+ assert count14[0][0] == 3 : "DUP inverted LIMIT+OFFSET near end: got ${count14[0][0]}"
+}
diff --git a/regression-test/suites/restore_p0/test_validate_restore_inverted_idx.groovy b/regression-test/suites/restore_p0/test_validate_restore_inverted_idx.groovy
index 1f3479d7353..663fd2a1f12 100644
--- a/regression-test/suites/restore_p0/test_validate_restore_inverted_idx.groovy
+++ b/regression-test/suites/restore_p0/test_validate_restore_inverted_idx.groovy
@@ -74,13 +74,13 @@ suite("test_validate_restore_inverted_idx", "validate_restore,nonConcurrent") {
// 1. query with inverted index
sql """ set enable_match_without_inverted_index = false """
sql """ set enable_fallback_on_missing_inverted_index = false """
- def res = sql """ SELECT /*+ SET_VAR(inverted_index_skip_threshold = 0, enable_common_expr_pushdown = true) */ * FROM ${dbName}.${tableName} WHERE value MATCH_ANY "10" """
+ def res = sql """ SELECT /*+ SET_VAR(inverted_index_skip_threshold = 0, enable_segment_limit_pushdown = true) */ * FROM ${dbName}.${tableName} WHERE value MATCH_ANY "10" """
assertTrue(res.size() > 0)
// 2. add partition and query
sql """ ALTER TABLE ${dbName}.${tableName} ADD PARTITION p8 VALUES LESS THAN ("80") """
sql """ INSERT INTO ${dbName}.${tableName} VALUES (75, "75 750", "76 77") """
- res = sql """ SELECT /*+ SET_VAR(inverted_index_skip_threshold = 0, enable_common_expr_pushdown = true) */ * FROM ${dbName}.${tableName} WHERE value MATCH_ANY "75" """
+ res = sql """ SELECT /*+ SET_VAR(inverted_index_skip_threshold = 0, enable_segment_limit_pushdown = true) */ * FROM ${dbName}.${tableName} WHERE value MATCH_ANY "75" """
assertTrue(res.size() > 0)
// 3. add new index
@@ -142,7 +142,7 @@ suite("test_validate_restore_inverted_idx", "validate_restore,nonConcurrent") {
assertTrue(false)
}
}
- res = sql """ SELECT /*+ SET_VAR(inverted_index_skip_threshold = 0, enable_common_expr_pushdown = true) */ * FROM ${dbName}.${tableName} WHERE value1 MATCH_ANY "12321" """
+ res = sql """ SELECT /*+ SET_VAR(inverted_index_skip_threshold = 0, enable_segment_limit_pushdown = true) */ * FROM ${dbName}.${tableName} WHERE value1 MATCH_ANY "12321" """
assertTrue(res.size() > 0)
} finally {
diff --git a/regression-test/suites/rollup_p0/test_materialized_view_common_expr_push_down.groovy b/regression-test/suites/rollup_p0/test_materialized_view_common_expr_push_down.groovy
index 31359db5fdd..aebb868787f 100644
--- a/regression-test/suites/rollup_p0/test_materialized_view_common_expr_push_down.groovy
+++ b/regression-test/suites/rollup_p0/test_materialized_view_common_expr_push_down.groovy
@@ -24,7 +24,7 @@ suite("test_materialized_view_common_expr_push_down") {
return jobStateResult[0][8]
}
- sql """set enable_common_expr_pushdown = true"""
+ sql """set enable_segment_limit_pushdown = true"""
sql "DROP TABLE IF EXISTS ${baseTable}"
sql """
diff --git a/regression-test/suites/search/test_disable_root_variant_match.groovy b/regression-test/suites/search/test_disable_root_variant_match.groovy
index affb5a82e50..d6e26a881a4 100644
--- a/regression-test/suites/search/test_disable_root_variant_match.groovy
+++ b/regression-test/suites/search/test_disable_root_variant_match.groovy
@@ -17,7 +17,7 @@
suite("test_disable_root_variant_match", "p0") {
sql """ set enable_match_without_inverted_index = false """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ set default_variant_enable_typed_paths_to_sparse = false """
sql """ set default_variant_enable_doc_mode = false """
@@ -60,7 +60,7 @@ suite("test_disable_root_variant_match", "p0") {
test {
sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id
FROM test_disable_root_variant_match_tbl
WHERE response MATCH 'doris'
ORDER BY id
@@ -70,7 +70,7 @@ suite("test_disable_root_variant_match", "p0") {
test {
sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id
FROM test_disable_root_variant_match_tbl
WHERE response_body MATCH_ANY 'doris'
OR response MATCH_ANY 'doris'
@@ -80,7 +80,7 @@ suite("test_disable_root_variant_match", "p0") {
}
def variantSubcolumnMatchResult = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id
FROM test_disable_root_variant_match_tbl
WHERE response['msg'] MATCH 'doris'
ORDER BY id
diff --git a/regression-test/suites/search/test_search_boundary_cases.groovy b/regression-test/suites/search/test_search_boundary_cases.groovy
index 30ae4aaa9a8..64b1520f9a5 100644
--- a/regression-test/suites/search/test_search_boundary_cases.groovy
+++ b/regression-test/suites/search/test_search_boundary_cases.groovy
@@ -18,8 +18,8 @@
suite("test_search_boundary_cases", "p0") {
def tableName = "search_boundary_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -88,71 +88,71 @@ suite("test_search_boundary_cases", "p0") {
// Boundary Test 1: All NULL fields
qt_boundary_1_all_null_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('field1:anything OR field2:anything OR field3:anything OR field4:anything OR field5:anything', '{"mode":"standard"}')
"""
qt_boundary_1_all_null_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('field1:anything AND field2:anything AND field3:anything AND field4:anything AND field5:anything', '{"mode":"standard"}')
"""
// Boundary Test 2: Single field NULL vs multiple fields NULL in OR
qt_boundary_2_single_null_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName}
WHERE search('field1:nonexistent OR field2:test', '{"mode":"standard"}')
ORDER BY id
"""
qt_boundary_2_multiple_null_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName}
WHERE search('field1:nonexistent OR field2:test OR field3:nonexistent', '{"mode":"standard"}')
ORDER BY id
"""
// Boundary Test 3: NOT with various NULL combinations
qt_boundary_3_not_null_field """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('NOT field1:test', '{"mode":"standard"}')
"""
qt_boundary_3_external_not_null """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE not search('field1:test', '{"mode":"standard"}')
"""
// Boundary Test 4: Empty string vs NULL handling
qt_boundary_4_empty_string_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName}
WHERE search('field1:""', '{"mode":"standard"}')
ORDER BY id
"""
qt_boundary_4_null_field_count """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE field1 IS NULL
"""
qt_boundary_4_empty_field_count """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE field1 = ''
"""
// Boundary Test 5: Complex nested boolean with NULLs
qt_boundary_5_complex_nested """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('((field1:test OR field2:test) AND (field3:test OR field4:test)) OR field5:test', '{"mode":"standard"}')
"""
qt_boundary_5_detailed_result """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, field1, field2, field3, field4, field5 FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, field1, field2, field3, field4, field5 FROM ${tableName}
WHERE search('((field1:test OR field2:test) AND (field3:test OR field4:test)) OR field5:test', '{"mode":"standard"}')
ORDER BY id
"""
// Boundary Test 6: Large OR query with many NULL fields
qt_boundary_6_large_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('field1:"target" OR field1:"keyword" OR field1:"apple" OR field1:"unique1" OR
field2:"target" OR field2:"keyword" OR field2:"apple" OR field2:"unique2" OR
field3:"target" OR field3:"keyword" OR field3:"banana" OR field3:"unique3" OR
@@ -162,36 +162,36 @@ suite("test_search_boundary_cases", "p0") {
// Boundary Test 7: Special characters and NULL interaction
qt_boundary_7_special_chars_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('field1:special123 OR field2:nonexistent', '{"mode":"standard"}')
"""
qt_boundary_7_special_chars_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('field1:special123 AND field2:chars456', '{"mode":"standard"}')
"""
// Boundary Test 8: Case sensitivity with NULL fields
qt_boundary_8_case_variations """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName}
WHERE search('field1:Target OR field2:TARGET OR field3:target OR field4:TaRgEt', '{"mode":"standard"}')
ORDER BY id
"""
// Boundary Test 9: Multiple NOT operations
qt_boundary_9_multiple_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('NOT (field1:nonexistent OR field2:nonexistent OR field3:nonexistent)', '{"mode":"standard"}')
"""
qt_boundary_9_external_multiple_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE not search('field1:nonexistent OR field2:nonexistent OR field3:nonexistent', '{"mode":"standard"}')
"""
// Boundary Test 10: Performance with NULL-heavy dataset
qt_boundary_10_performance """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('(field1:test OR field1:target OR field1:keyword) AND
(field2:test OR field2:target OR field2:keyword) AND
NOT (field3:nonexistent OR field4:nonexistent OR field5:nonexistent)', '{"mode":"standard"}')
diff --git a/regression-test/suites/search/test_search_cache.groovy b/regression-test/suites/search/test_search_cache.groovy
index 4ebb5c173a2..16281d4869c 100644
--- a/regression-test/suites/search/test_search_cache.groovy
+++ b/regression-test/suites/search/test_search_cache.groovy
@@ -50,7 +50,7 @@ suite("test_search_cache", "p0") {
// Test 1: Cache consistency - same query returns same results with cache enabled
def result1 = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true,enable_inverted_index_query_cache=true) */
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true,enable_inverted_index_query_cache=true) */
id FROM ${tableName}
WHERE search('title:apple')
ORDER BY id
@@ -58,7 +58,7 @@ suite("test_search_cache", "p0") {
// Run same query again (should hit cache)
def result2 = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true,enable_inverted_index_query_cache=true) */
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true,enable_inverted_index_query_cache=true) */
id FROM ${tableName}
WHERE search('title:apple')
ORDER BY id
@@ -69,7 +69,7 @@ suite("test_search_cache", "p0") {
// Test 2: Cache disabled returns same results as cache enabled
def result_no_cache = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true,enable_inverted_index_query_cache=false) */
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true,enable_inverted_index_query_cache=false) */
id FROM ${tableName}
WHERE search('title:apple')
ORDER BY id
@@ -78,14 +78,14 @@ suite("test_search_cache", "p0") {
// Test 3: Multi-field query cache consistency
def mf_result1 = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true,enable_inverted_index_query_cache=true) */
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true,enable_inverted_index_query_cache=true) */
id FROM ${tableName}
WHERE search('title:cherry OR content:tropical')
ORDER BY id
"""
def mf_result2 = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true,enable_inverted_index_query_cache=true) */
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true,enable_inverted_index_query_cache=true) */
id FROM ${tableName}
WHERE search('title:cherry OR content:tropical')
ORDER BY id
@@ -94,7 +94,7 @@ suite("test_search_cache", "p0") {
// Test 4: Different queries produce different cache entries
def diff_result = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true,enable_inverted_index_query_cache=true) */
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true,enable_inverted_index_query_cache=true) */
id FROM ${tableName}
WHERE search('title:banana')
ORDER BY id
@@ -104,14 +104,14 @@ suite("test_search_cache", "p0") {
// Test 5: AND query - cache vs no-cache consistency
def and_cached = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true,enable_inverted_index_query_cache=true) */
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true,enable_inverted_index_query_cache=true) */
id, title FROM ${tableName}
WHERE search('title:apple AND title:cherry')
ORDER BY id
"""
def and_uncached = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true,enable_inverted_index_query_cache=false) */
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true,enable_inverted_index_query_cache=false) */
id, title FROM ${tableName}
WHERE search('title:apple AND title:cherry')
ORDER BY id
@@ -120,14 +120,14 @@ suite("test_search_cache", "p0") {
// Test 6: Complex boolean query - cache vs no-cache consistency
def complex_cached = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true,enable_inverted_index_query_cache=true) */
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true,enable_inverted_index_query_cache=true) */
id, title FROM ${tableName}
WHERE search('(title:apple OR title:banana) AND content:fruit')
ORDER BY id
"""
def complex_uncached = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true,enable_inverted_index_query_cache=false) */
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true,enable_inverted_index_query_cache=false) */
id, title FROM ${tableName}
WHERE search('(title:apple OR title:banana) AND content:fruit')
ORDER BY id
diff --git a/regression-test/suites/search/test_search_default_field_operator.groovy b/regression-test/suites/search/test_search_default_field_operator.groovy
index 654a9ad2abf..3eb586a1fb1 100644
--- a/regression-test/suites/search/test_search_default_field_operator.groovy
+++ b/regression-test/suites/search/test_search_default_field_operator.groovy
@@ -18,8 +18,8 @@
suite("test_search_default_field_operator", "p0") {
def tableName = "search_enhanced_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -59,7 +59,7 @@ suite("test_search_default_field_operator", "p0") {
// Expected: Chris (1), Christopher (2)
// Note: Without parser, inverted index is case-sensitive
qt_wildcard_prefix """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('Chris*', '{"default_field":"firstname"}')
ORDER BY id
@@ -70,7 +70,7 @@ suite("test_search_default_field_operator", "p0") {
// SQL: search('foo bar', '{"default_field":"tags","default_operator":"and"}')
// Expected: 'foo bar' (1), 'bar foo' (3)
qt_multi_term_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, tags
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, tags
FROM ${tableName}
WHERE search('foo bar', '{"default_field":"tags","default_operator":"and"}')
ORDER BY id
@@ -81,7 +81,7 @@ suite("test_search_default_field_operator", "p0") {
// SQL: search('foo bark', '{"default_field":"tags","default_operator":"or"}')
// Expected: 'foo bar' (1), 'bar foo' (3), 'foolish bark' (4)
qt_multi_term_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, tags
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, tags
FROM ${tableName}
WHERE search('foo bark', '{"default_field":"tags","default_operator":"or"}')
ORDER BY id
@@ -97,7 +97,7 @@ suite("test_search_default_field_operator", "p0") {
// - 'bar foo' (3): tokens=['bar','foo'] - matches foo* ✓ and bar* ✓
// - 'foolish bark' (4): tokens=['foolish','bark'] - matches foo* ✓ and bar* ✓
qt_wildcard_multi_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, tags
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, tags
FROM ${tableName}
WHERE search('foo* bar*', '{"default_field":"tags","default_operator":"and"}')
ORDER BY id
@@ -108,7 +108,7 @@ suite("test_search_default_field_operator", "p0") {
// The explicit OR in DSL should override the default 'and' operator
// Expected: 'foo bar' (1), 'bar foo' (3), 'foolish bark' (4)
qt_explicit_or_override """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, tags
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, tags
FROM ${tableName}
WHERE search('foo OR bark', '{"default_field":"tags","default_operator":"and"}')
ORDER BY id
@@ -119,7 +119,7 @@ suite("test_search_default_field_operator", "p0") {
// SQL: search('EXACT(foo bar)', '{"default_field":"tags_exact"}')
// Expected: 'foo bar' (1) only - exact string match
qt_exact_function """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, tags_exact
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, tags_exact
FROM ${tableName}
WHERE search('EXACT(foo bar)', '{"default_field":"tags_exact"}')
ORDER BY id
@@ -128,7 +128,7 @@ suite("test_search_default_field_operator", "p0") {
// ============ Test 7: Traditional syntax still works ============
// Ensure backward compatibility - original syntax unchanged
qt_traditional_syntax """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('firstname:Chris*')
ORDER BY id
@@ -136,7 +136,7 @@ suite("test_search_default_field_operator", "p0") {
// ============ Test 8: Single term with default field ============
qt_single_term """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, tags
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, tags
FROM ${tableName}
WHERE search('bar', '{"default_field":"tags"}')
ORDER BY id
@@ -144,7 +144,7 @@ suite("test_search_default_field_operator", "p0") {
// ============ Test 9: Wildcard in middle ============
qt_wildcard_middle """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('*ris*', '{"default_field":"firstname"}')
ORDER BY id
@@ -154,7 +154,7 @@ suite("test_search_default_field_operator", "p0") {
// Without parser, wildcard queries are case-sensitive (matches Lucene behavior)
// CHRIS* won't match Chris/Christopher
qt_case_sensitive """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('CHRIS*', '{"default_field":"firstname"}')
ORDER BY id
@@ -162,7 +162,7 @@ suite("test_search_default_field_operator", "p0") {
// ============ Test 11: Default operator is OR when not specified ============
qt_default_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, tags
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, tags
FROM ${tableName}
WHERE search('foo bark', '{"default_field":"tags"}')
ORDER BY id
@@ -170,7 +170,7 @@ suite("test_search_default_field_operator", "p0") {
// ============ Test 12: ANY function with default field ============
qt_any_function """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, tags
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, tags
FROM ${tableName}
WHERE search('ANY(foo bark)', '{"default_field":"tags"}')
ORDER BY id
@@ -178,7 +178,7 @@ suite("test_search_default_field_operator", "p0") {
// ============ Test 13: ALL function with default field ============
qt_all_function """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, tags
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, tags
FROM ${tableName}
WHERE search('ALL(foo bar)', '{"default_field":"tags"}')
ORDER BY id
@@ -186,7 +186,7 @@ suite("test_search_default_field_operator", "p0") {
// ============ Test 14: Complex wildcard pattern ============
qt_complex_wildcard """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('?evin', '{"default_field":"firstname"}')
ORDER BY id
@@ -194,7 +194,7 @@ suite("test_search_default_field_operator", "p0") {
// ============ Test 15: Default field with explicit AND ============
qt_explicit_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, tags
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, tags
FROM ${tableName}
WHERE search('foo AND bar', '{"default_field":"tags"}')
ORDER BY id
@@ -202,7 +202,7 @@ suite("test_search_default_field_operator", "p0") {
// ============ Test 16: Multiple fields still work ============
qt_multiple_fields """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname, tags
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname, tags
FROM ${tableName}
WHERE search('firstname:Chris* OR tags:bark')
ORDER BY id
@@ -210,7 +210,7 @@ suite("test_search_default_field_operator", "p0") {
// ============ Test 17: NOT operator with default field ============
qt_not_operator """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, tags
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, tags
FROM ${tableName}
WHERE search('NOT foobar', '{"default_field":"tags"}')
ORDER BY id
@@ -222,7 +222,7 @@ suite("test_search_default_field_operator", "p0") {
// - search('foo*', '{"default_field":"tags","default_operator":"or"}'): 2-param with JSON options → matches id 1,3,4
// - OR combination → matches id 1,2,3,4 (all rows)
qt_param_count_mix """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id
FROM ${tableName}
WHERE search('firstname:Chris*') OR search('foo*', '{"default_field":"tags","default_operator":"or"}')
ORDER BY id
diff --git a/regression-test/suites/search/test_search_dsl_operators.groovy b/regression-test/suites/search/test_search_dsl_operators.groovy
index 8be39c610ae..4ca11f72877 100644
--- a/regression-test/suites/search/test_search_dsl_operators.groovy
+++ b/regression-test/suites/search/test_search_dsl_operators.groovy
@@ -38,8 +38,8 @@
suite("test_search_dsl_operators", "p0") {
def tableName = "search_dsl_operators_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -73,7 +73,7 @@ suite("test_search_dsl_operators", "p0") {
// All OR operators -> at least one must match (minimum_should_match=1)
// Expected: rows 1,2,3,4 (all match at least one term)
qt_dsl_or_chain """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('aterm OR bterm OR cterm', '{"default_field":"firstname","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -83,7 +83,7 @@ suite("test_search_dsl_operators", "p0") {
// All AND operators -> all must match
// Expected: row 4 only (the only one with all three terms)
qt_dsl_and_chain """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('dterm AND eterm AND aterm', '{"default_field":"firstname","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -99,7 +99,7 @@ suite("test_search_dsl_operators", "p0") {
// Result: effectively +aterm only
// Expected: rows 1, 4 (rows containing "aterm")
qt_dsl_and_or_mixed """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('aterm AND bterm OR cterm', '{"default_field":"firstname","default_operator":"and","mode":"lucene","minimum_should_match":0}')
ORDER BY id
@@ -115,7 +115,7 @@ suite("test_search_dsl_operators", "p0") {
// Result: +aterm -bterm
// Expected: row 4 only (has "aterm" but NOT "bterm")
qt_dsl_and_not_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('aterm AND NOT bterm OR cterm', '{"default_field":"firstname","default_operator":"and","mode":"lucene","minimum_should_match":0}')
ORDER BY id
@@ -126,7 +126,7 @@ suite("test_search_dsl_operators", "p0") {
// Same as: cterm AND dterm
// Expected: row 3 only (has both "cterm" AND "dterm")
qt_dsl_implicit_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('cterm dterm', '{"default_field":"firstname","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -137,7 +137,7 @@ suite("test_search_dsl_operators", "p0") {
// Data has "dterm eterm aterm" - "aterm" comes AFTER "eterm", not before
// Expected: no match
qt_dsl_phrase_wrong_order """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('"aterm eterm"', '{"default_field":"firstname","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -148,7 +148,7 @@ suite("test_search_dsl_operators", "p0") {
// Data has "dterm eterm aterm" - "eterm aterm" appears in this order
// Expected: row 4
qt_dsl_phrase_correct_order """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('"eterm aterm"', '{"default_field":"firstname","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -161,7 +161,7 @@ suite("test_search_dsl_operators", "p0") {
// Row 4 contains all terms (dterm, eterm, aterm)
// Expected: row 4
qt_dsl_escaped_space_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('eterm\\\\ dterm AND aterm', '{"default_field":"firstname","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -172,7 +172,7 @@ suite("test_search_dsl_operators", "p0") {
// Row 4 has "dterm eterm aterm" - phrase "dterm eterm" matches, and "aterm" is also present
// Expected: row 4
qt_dsl_phrase_and_term """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('"dterm eterm" AND aterm', '{"default_field":"firstname","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -182,7 +182,7 @@ suite("test_search_dsl_operators", "p0") {
// Phrase "eterm dterm" is wrong order (data has "dterm eterm")
// Expected: no match
qt_dsl_phrase_wrong_and_term """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('"eterm dterm" AND aterm', '{"default_field":"firstname","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -194,7 +194,7 @@ suite("test_search_dsl_operators", "p0") {
// cterm matches rows 2, 3
// Expected: rows 2, 3
qt_dsl_phrase_or_term_1 """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('"eterm dterm" OR cterm', '{"default_field":"firstname","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -206,7 +206,7 @@ suite("test_search_dsl_operators", "p0") {
// cterm matches rows 2, 3
// Expected: rows 2, 3, 4
qt_dsl_phrase_or_term_2 """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('"dterm eterm" OR cterm', '{"default_field":"firstname","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -224,7 +224,7 @@ suite("test_search_dsl_operators", "p0") {
// Actually row 4 has aterm but no bterm/cterm...
// Expected: row 1 only
qt_dsl_and_or_min_should_1 """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, firstname
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, firstname
FROM ${tableName}
WHERE search('aterm AND bterm OR cterm', '{"default_field":"firstname","default_operator":"and","mode":"lucene","minimum_should_match":1}')
ORDER BY id
diff --git a/regression-test/suites/search/test_search_dsl_syntax.groovy b/regression-test/suites/search/test_search_dsl_syntax.groovy
index b52a018fa03..23887f2ab4d 100644
--- a/regression-test/suites/search/test_search_dsl_syntax.groovy
+++ b/regression-test/suites/search/test_search_dsl_syntax.groovy
@@ -88,38 +88,38 @@ suite("test_search_dsl_syntax", "p0") {
Thread.sleep(5000)
// DSL Syntax Test 1: Simple term queries
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:Machine') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:Machine') ORDER BY id"
// DSL Syntax Test 2: Phrase queries with quotes
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:\"Machine Learning\"')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:\"Machine Learning\"')"
// DSL Syntax Test 3: Wildcard queries
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:*Learning') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:*Learning') ORDER BY id"
// DSL Syntax Test 4: Prefix queries
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:Data*')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:Data*')"
// DSL Syntax Test 5: Regular expression queries
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:/.*[Dd]ata.*/')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:/.*[Dd]ata.*/')"
// DSL Syntax Test 6: Boolean AND operator
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('category:Technology AND tags:AI') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('category:Technology AND tags:AI') ORDER BY id"
// DSL Syntax Test 7: Boolean OR operator
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('category:Programming OR category:Science') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('category:Programming OR category:Science') ORDER BY id"
// DSL Syntax Test 8: Boolean NOT operator
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableName} WHERE search('status:published AND NOT category:Technology')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableName} WHERE search('status:published AND NOT category:Technology')"
// DSL Syntax Test 9: Parentheses for grouping
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('(category:Technology OR category:AI) AND status:published') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('(category:Technology OR category:AI) AND status:published') ORDER BY id"
// DSL Syntax Test 10: Complex nested queries
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('(title:Learning OR title:Development) AND (status:published OR status:review)') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('(title:Learning OR title:Development) AND (status:published OR status:review)') ORDER BY id"
// DSL Syntax Test 11: Range queries (if supported)
try {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('priority:[1 TO 2]') ORDER BY id"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('priority:[1 TO 2]') ORDER BY id"
// This may or may not work depending on implementation
} catch (Exception e) {
// Range queries might not be implemented yet
@@ -128,7 +128,7 @@ suite("test_search_dsl_syntax", "p0") {
// DSL Syntax Test 12: List queries with IN operator (if supported)
try {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('status:IN(published draft)') "
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('status:IN(published draft)') "
"ORDER BY id"
// This may or may not work depending on implementation
} catch (Exception e) {
@@ -137,34 +137,34 @@ suite("test_search_dsl_syntax", "p0") {
}
// DSL Syntax Test 13: ANY queries
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('tags:ANY(AI python)') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('tags:ANY(AI python)') ORDER BY id"
// DSL Syntax Test 14: ALL queries
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('tags:ALL(machine learning)') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('tags:ALL(machine learning)') ORDER BY id"
// DSL Syntax Test 15: Field names with quotes
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('\"content\":programming') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('\"content\":programming') ORDER BY id"
// DSL Syntax Test 16: Case insensitive field names
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('CONTENT:programming') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('CONTENT:programming') ORDER BY id"
// DSL Syntax Test 17: Multiple terms in same field
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('content:machine AND content:learning') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('content:machine AND content:learning') ORDER BY id"
// DSL Syntax Test 18: Hyphenated terms in tags
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('tags:machine-learning') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('tags:machine-learning') ORDER BY id"
// DSL Syntax Test 19: Special characters in search terms
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('author:\"John Doe\"') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('author:\"John Doe\"') ORDER BY id"
// DSL Syntax Test 20: Multiple field search with complex boolean logic
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('(title:Learning AND category:Technology) OR (title:Development AND category:Web)') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('(title:Learning AND category:Technology) OR (title:Development AND category:Web)') ORDER BY id"
// Error handling tests for invalid DSL syntax
// Error Test 1: Unclosed parentheses
try {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('(title:Machine') ORDER BY id"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('(title:Machine') ORDER BY id"
assertTrue(false, "Expected exception for unclosed parentheses")
} catch (Exception e) {
assertTrue(e.getMessage().contains("Invalid") || e.getMessage().contains("syntax"))
@@ -172,7 +172,7 @@ suite("test_search_dsl_syntax", "p0") {
// Error Test 2: Missing field name
try {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search(':value') ORDER BY id"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search(':value') ORDER BY id"
assertTrue(false, "Expected exception for missing field name")
} catch (Exception e) {
assertTrue(e.getMessage().contains("Invalid") || e.getMessage().contains("syntax"))
@@ -180,7 +180,7 @@ suite("test_search_dsl_syntax", "p0") {
// Error Test 3: Missing value
try {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('field:') ORDER BY id"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('field:') ORDER BY id"
assertTrue(false, "Expected exception for missing value")
} catch (Exception e) {
assertTrue(e.getMessage().contains("Invalid") || e.getMessage().contains("syntax"))
@@ -188,7 +188,7 @@ suite("test_search_dsl_syntax", "p0") {
// Error Test 4: Invalid boolean operator
try {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('title:Machine XOR category:Technology') ORDER BY id"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('title:Machine XOR category:Technology') ORDER BY id"
assertTrue(false, "Expected exception for invalid boolean operator")
} catch (Exception e) {
assertTrue(e.getMessage().contains("Invalid") || e.getMessage().contains("syntax"))
@@ -196,7 +196,7 @@ suite("test_search_dsl_syntax", "p0") {
// Error Test 5: Unclosed quotes
try {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('title:\"Machine Learning') ORDER BY id"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('title:\"Machine Learning') ORDER BY id"
assertTrue(false, "Expected exception for unclosed quotes")
} catch (Exception e) {
assertTrue(e.getMessage().contains("Invalid") || e.getMessage().contains("syntax"))
@@ -204,7 +204,7 @@ suite("test_search_dsl_syntax", "p0") {
// Error Test 6: Invalid regular expression
//try {
- // sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('title:/[invalid/') ORDER BY id"
+ // sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('title:/[invalid/') ORDER BY id"
// assertTrue(false, "Expected exception for invalid regex")
//} catch (Exception e) {
// assertTrue(e.getMessage().contains("Invalid") || e.getMessage().contains("syntax"))
@@ -214,7 +214,7 @@ suite("test_search_dsl_syntax", "p0") {
// Edge Case Test 1: Empty search string
try {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('') ORDER BY id"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('') ORDER BY id"
// Should handle empty string gracefully
} catch (Exception e) {
assertTrue(e.getMessage().contains("only inverted index queries are supported") || e.getMessage().contains("Invalid"))
@@ -223,7 +223,7 @@ suite("test_search_dsl_syntax", "p0") {
// Edge Case Test 2: Very long search string
def longTerm = "a" * 1000
try {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('title:${longTerm}') ORDER BY id"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('title:${longTerm}') ORDER BY id"
// Should handle long strings gracefully
} catch (Exception e) {
// Acceptable if implementation has length limits
@@ -232,7 +232,7 @@ suite("test_search_dsl_syntax", "p0") {
// Edge Case Test 3: Unicode characters
try {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('title:测试') ORDER BY id"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('title:测试') ORDER BY id"
// Should handle Unicode gracefully
} catch (Exception e) {
logger.info("Unicode search error: " + e.getMessage())
@@ -241,75 +241,75 @@ suite("test_search_dsl_syntax", "p0") {
// NOT search functionality tests
// NOT Search Test 1: Basic NOT search for content field
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${tableName} WHERE NOT search('content:msg') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${tableName} WHERE NOT search('content:msg') ORDER BY id"
// NOT Search Test 2: NOT search with specific field
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE NOT search('title:Message') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE NOT search('title:Message') ORDER BY id"
// NOT Search Test 3: NOT search with multiple terms
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE NOT search('content:message AND category:Message') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE NOT search('content:message AND category:Message') ORDER BY id"
// NOT Search Test 4: NOT search with complex boolean logic
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE NOT search('(content:msg OR title:Message) AND status:published') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE NOT search('(content:msg OR title:Message) AND status:published') ORDER BY id"
// NOT Search Test 5: NOT search with wildcard
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE NOT search('content:*msg*') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE NOT search('content:*msg*') ORDER BY id"
// NOT Search Test 6: NOT search with phrase
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE NOT search('content:\"success message\"') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE NOT search('content:\"success message\"') ORDER BY id"
// Null value handling tests
// Null Test 1: Search on field with null values
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${tableName} WHERE search('content:null') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${tableName} WHERE search('content:null') ORDER BY id"
// Null Test 2: Search on null field should return no results
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:null') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:null') ORDER BY id"
// Null Test 3: NOT search on field with null values
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${tableName} WHERE NOT search('content:null') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${tableName} WHERE NOT search('content:null') ORDER BY id"
// Null Test 4: Search on category field with null values
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, category FROM ${tableName} WHERE search('category:Test') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, category FROM ${tableName} WHERE search('category:Test') ORDER BY id"
// Null Test 5: NOT search on category field with null values
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, category FROM ${tableName} WHERE NOT search('category:Test') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, category FROM ${tableName} WHERE NOT search('category:Test') ORDER BY id"
// Null Test 6: Search on tags field with null values
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, tags FROM ${tableName} WHERE search('tags:test') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, tags FROM ${tableName} WHERE search('tags:test') ORDER BY id"
// Null Test 7: NOT search on tags field with null values
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, tags FROM ${tableName} WHERE NOT search('tags:test') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, tags FROM ${tableName} WHERE NOT search('tags:test') ORDER BY id"
// Null Test 8: Search on author field with null values
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, author FROM ${tableName} WHERE search('author:Test') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, author FROM ${tableName} WHERE search('author:Test') ORDER BY id"
// Null Test 9: NOT search on author field with null values
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, author FROM ${tableName} WHERE NOT search('author:Test') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, author FROM ${tableName} WHERE NOT search('author:Test') ORDER BY id"
// Null Test 10: Search on status field with null values
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, status FROM ${tableName} WHERE search('status:draft') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, status FROM ${tableName} WHERE search('status:draft') ORDER BY id"
// Null Test 11: NOT search on status field with null values
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, status FROM ${tableName} WHERE NOT search('status:draft') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, status FROM ${tableName} WHERE NOT search('status:draft') ORDER BY id"
// Combined NOT search and null handling tests
// Combined Test 1: NOT search with null content handling
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${tableName} WHERE NOT search('content:msg') AND content IS NOT NULL ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${tableName} WHERE NOT search('content:msg') AND content IS NOT NULL ORDER BY id"
// Combined Test 2: NOT search with null title handling
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE NOT search('title:Test') AND title IS NOT NULL ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE NOT search('title:Test') AND title IS NOT NULL ORDER BY id"
// Combined Test 3: NOT search with null category handling
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, category FROM ${tableName} WHERE NOT search('category:Test') AND category IS NOT NULL ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, category FROM ${tableName} WHERE NOT search('category:Test') AND category IS NOT NULL ORDER BY id"
// Combined Test 4: NOT search with null tags handling
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, tags FROM ${tableName} WHERE NOT search('tags:test') AND tags IS NOT NULL ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, tags FROM ${tableName} WHERE NOT search('tags:test') AND tags IS NOT NULL ORDER BY id"
// Combined Test 5: NOT search with null author handling
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, author FROM ${tableName} WHERE NOT search('author:Test') AND author IS NOT NULL ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, author FROM ${tableName} WHERE NOT search('author:Test') AND author IS NOT NULL ORDER BY id"
// Combined Test 6: NOT search with null status handling
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, status FROM ${tableName} WHERE NOT search('status:draft') AND status IS NOT NULL ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, status FROM ${tableName} WHERE NOT search('status:draft') AND status IS NOT NULL ORDER BY id"
}
diff --git a/regression-test/suites/search/test_search_escape.groovy b/regression-test/suites/search/test_search_escape.groovy
index e7e09ca846c..0a72a81bc2b 100644
--- a/regression-test/suites/search/test_search_escape.groovy
+++ b/regression-test/suites/search/test_search_escape.groovy
@@ -32,8 +32,8 @@
suite("test_search_escape", "p0") {
def tableName = "search_escape_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -74,7 +74,7 @@ suite("test_search_escape", "p0") {
// Groovy: \\\\ -> SQL: \\ -> DSL: \ (escape)
// This should match row 1 which has "First Value" stored as single term (parser=none)
qt_escape_space """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:First\\\\ Value')
ORDER BY id
@@ -85,7 +85,7 @@ suite("test_search_escape", "p0") {
// This query won't work as expected, showing the difference
// Using phrase query instead to show the contrast
qt_phrase_query """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:"First Value"')
ORDER BY id
@@ -95,7 +95,7 @@ suite("test_search_escape", "p0") {
// DSL: title:hello\(world\) -> searches for literal "hello(world)"
// Groovy: \\\\( -> SQL: \\( -> DSL: \( -> literal: (
qt_escape_parentheses """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:hello\\\\(world\\\\)')
ORDER BY id
@@ -105,7 +105,7 @@ suite("test_search_escape", "p0") {
// DSL: title:key\:value -> searches for literal "key:value"
// Groovy: \\\\: -> SQL: \\: -> DSL: \: -> literal: :
qt_escape_colon """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:key\\\\:value')
ORDER BY id
@@ -116,7 +116,7 @@ suite("test_search_escape", "p0") {
// Groovy: \\\\\\\\ -> SQL: \\\\ -> DSL: \\ -> literal: \
// Data stored: path\to\file (Groovy \\\\ -> SQL \\ -> stored \)
qt_escape_backslash """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:path\\\\\\\\to\\\\\\\\file')
ORDER BY id
@@ -124,7 +124,7 @@ suite("test_search_escape", "p0") {
// ============ Test 6: Uppercase AND operator ============
qt_uppercase_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content
FROM ${tableName}
WHERE search('content:first AND content:fruit')
ORDER BY id
@@ -132,7 +132,7 @@ suite("test_search_escape", "p0") {
// ============ Test 7: Uppercase OR operator ============
qt_uppercase_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content
FROM ${tableName}
WHERE search('content:first OR content:second')
ORDER BY id
@@ -140,7 +140,7 @@ suite("test_search_escape", "p0") {
// ============ Test 8: Uppercase NOT operator ============
qt_uppercase_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content
FROM ${tableName}
WHERE search('content:fruit AND NOT content:first')
ORDER BY id
@@ -151,7 +151,7 @@ suite("test_search_escape", "p0") {
// Lowercase 'and' is treated as a bare term (no field), causing error
test {
sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content
FROM ${tableName}
WHERE search('content:first and content:fruit')
ORDER BY id
@@ -164,7 +164,7 @@ suite("test_search_escape", "p0") {
// Lowercase 'or' is treated as a bare term (no field), causing error
test {
sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content
FROM ${tableName}
WHERE search('content:first or content:second')
ORDER BY id
@@ -174,7 +174,7 @@ suite("test_search_escape", "p0") {
// ============ Test 11: Exclamation NOT operator ============
qt_exclamation_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content
FROM ${tableName}
WHERE search('content:fruit AND !content:first')
ORDER BY id
@@ -183,7 +183,7 @@ suite("test_search_escape", "p0") {
// ============ Test 12: Default field with escaped space ============
// DSL: First\ Value with default_field=title (JSON options format)
qt_default_field_escape """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('First\\\\ Value', '{"default_field":"title","default_operator":"and"}')
ORDER BY id
@@ -191,7 +191,7 @@ suite("test_search_escape", "p0") {
// ============ Test 13: Lucene mode with escaped space ============
qt_lucene_mode_escape """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('First\\\\ Value', '{"default_field":"title","default_operator":"and","mode":"lucene"}')
ORDER BY id
diff --git a/regression-test/suites/search/test_search_exact_basic.groovy b/regression-test/suites/search/test_search_exact_basic.groovy
index ffad823e451..776a3064015 100644
--- a/regression-test/suites/search/test_search_exact_basic.groovy
+++ b/regression-test/suites/search/test_search_exact_basic.groovy
@@ -18,8 +18,8 @@
suite("test_search_exact_basic", "p0") {
def tableName = "exact_basic_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -48,11 +48,11 @@ suite("test_search_exact_basic", "p0") {
Thread.sleep(3000)
// Test 1: EXACT should match the whole value
- qt_exact_whole "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, name FROM ${tableName} WHERE search('name:EXACT(apple banana)') ORDER BY id"
+ qt_exact_whole "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, name FROM ${tableName} WHERE search('name:EXACT(apple banana)') ORDER BY id"
// Test 2: EXACT should not match partial
- qt_exact_partial "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, name FROM ${tableName} WHERE search('name:EXACT(apple)') ORDER BY id"
+ qt_exact_partial "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, name FROM ${tableName} WHERE search('name:EXACT(apple)') ORDER BY id"
// Test 3: EXACT is case sensitive (without lowercase config)
- qt_exact_case "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, name FROM ${tableName} WHERE search('name:EXACT(Apple)') ORDER BY id"
+ qt_exact_case "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, name FROM ${tableName} WHERE search('name:EXACT(Apple)') ORDER BY id"
}
diff --git a/regression-test/suites/search/test_search_exact_lowercase.groovy b/regression-test/suites/search/test_search_exact_lowercase.groovy
index f4b82d411b6..f9eba49b260 100644
--- a/regression-test/suites/search/test_search_exact_lowercase.groovy
+++ b/regression-test/suites/search/test_search_exact_lowercase.groovy
@@ -18,8 +18,8 @@
suite("test_search_exact_lowercase", "p0") {
def tableName = "exact_lowercase_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -53,20 +53,20 @@ suite("test_search_exact_lowercase", "p0") {
Thread.sleep(3000)
// Test 1: EXACT on normal field (untokenized) - case sensitive
- qt_normal_exact_lower "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, text_normal FROM ${tableName} WHERE search('text_normal:EXACT(hello world)') ORDER BY id"
- qt_normal_exact_upper "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, text_normal FROM ${tableName} WHERE search('text_normal:EXACT(HELLO WORLD)') ORDER BY id"
- qt_normal_exact_mixed "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, text_normal FROM ${tableName} WHERE search('text_normal:EXACT(Hello World)') ORDER BY id"
+ qt_normal_exact_lower "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, text_normal FROM ${tableName} WHERE search('text_normal:EXACT(hello world)') ORDER BY id"
+ qt_normal_exact_upper "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, text_normal FROM ${tableName} WHERE search('text_normal:EXACT(HELLO WORLD)') ORDER BY id"
+ qt_normal_exact_mixed "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, text_normal FROM ${tableName} WHERE search('text_normal:EXACT(Hello World)') ORDER BY id"
// Test 2: EXACT on mixed index field
// EXACT prefers untokenized index, so it's case sensitive (lowercase config is ignored)
- qt_mixed_exact_lower "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, text_mixed FROM ${tableName} WHERE search('text_mixed:EXACT(hello world)') ORDER BY id"
- qt_mixed_exact_upper "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, text_mixed FROM ${tableName} WHERE search('text_mixed:EXACT(HELLO WORLD)') ORDER BY id"
- qt_mixed_exact_mixed "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, text_mixed FROM ${tableName} WHERE search('text_mixed:EXACT(Hello World)') ORDER BY id"
+ qt_mixed_exact_lower "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, text_mixed FROM ${tableName} WHERE search('text_mixed:EXACT(hello world)') ORDER BY id"
+ qt_mixed_exact_upper "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, text_mixed FROM ${tableName} WHERE search('text_mixed:EXACT(HELLO WORLD)') ORDER BY id"
+ qt_mixed_exact_mixed "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, text_mixed FROM ${tableName} WHERE search('text_mixed:EXACT(Hello World)') ORDER BY id"
// Test 3: Verify that ANY on mixed index uses tokenized index with lowercase
- qt_mixed_any_lowercase "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, text_mixed FROM ${tableName} WHERE search('text_mixed:ANY(hello world)') ORDER BY id"
+ qt_mixed_any_lowercase "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, text_mixed FROM ${tableName} WHERE search('text_mixed:ANY(hello world)') ORDER BY id"
// Test 4: Compare EXACT (case-sensitive) vs ANY (with lowercase)
- qt_exact_case_sensitive "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('text_mixed:EXACT(Test Case)') ORDER BY id"
- qt_any_case_insensitive "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('text_mixed:ANY(test case)') ORDER BY id"
+ qt_exact_case_sensitive "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('text_mixed:EXACT(Test Case)') ORDER BY id"
+ qt_any_case_insensitive "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('text_mixed:ANY(test case)') ORDER BY id"
}
diff --git a/regression-test/suites/search/test_search_exact_match.groovy b/regression-test/suites/search/test_search_exact_match.groovy
index 6f8439b0d22..488d5e65dd5 100644
--- a/regression-test/suites/search/test_search_exact_match.groovy
+++ b/regression-test/suites/search/test_search_exact_match.groovy
@@ -18,8 +18,8 @@
suite("test_search_exact_match", "p0") {
def tableName = "search_exact_test_table"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -61,58 +61,58 @@ suite("test_search_exact_match", "p0") {
Thread.sleep(5000)
// Test 1: EXACT match without tokenization - exact case matching
- qt_exact_basic "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:EXACT(Hello World)') ORDER BY id"
+ qt_exact_basic "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:EXACT(Hello World)') ORDER BY id"
// Test 2: EXACT match should not find partial matches (unlike ANY)
- qt_exact_no_partial "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:EXACT(Hello)') ORDER BY id"
+ qt_exact_no_partial "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:EXACT(Hello)') ORDER BY id"
// Test 3: EXACT match on field without tokenization - case sensitive
- qt_exact_case_sensitive "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, keyword FROM ${tableName} WHERE search('keyword:EXACT(hello world)') ORDER BY id"
+ qt_exact_case_sensitive "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, keyword FROM ${tableName} WHERE search('keyword:EXACT(hello world)') ORDER BY id"
// Test 4: EXACT match with different case
- qt_exact_different_case "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, keyword FROM ${tableName} WHERE search('keyword:EXACT(HELLO WORLD)') ORDER BY id"
+ qt_exact_different_case "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, keyword FROM ${tableName} WHERE search('keyword:EXACT(HELLO WORLD)') ORDER BY id"
// Test 5: EXACT match with spaces
- qt_exact_spaces "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, keyword FROM ${tableName} WHERE search('keyword:EXACT(a b c)') ORDER BY id"
+ qt_exact_spaces "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, keyword FROM ${tableName} WHERE search('keyword:EXACT(a b c)') ORDER BY id"
// Test 6: Compare EXACT vs ANY on tokenized field
- qt_exact_vs_any_exact "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:EXACT(test document)') ORDER BY id"
- qt_exact_vs_any_any "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:ALL(test document)') ORDER BY id"
+ qt_exact_vs_any_exact "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:EXACT(test document)') ORDER BY id"
+ qt_exact_vs_any_any "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:ALL(test document)') ORDER BY id"
// Test 7: EXACT on field with mixed index (both tokenized and untokenized)
// EXACT should use the untokenized index
- qt_exact_mixed_index "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, mixed_index FROM ${tableName} WHERE search('mixed_index:EXACT(machine learning)') ORDER BY id"
+ qt_exact_mixed_index "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, mixed_index FROM ${tableName} WHERE search('mixed_index:EXACT(machine learning)') ORDER BY id"
// Test 8: EXACT with special characters
- qt_exact_special_chars "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:EXACT(Special!@#Chars)') ORDER BY id"
+ qt_exact_special_chars "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:EXACT(Special!@#Chars)') ORDER BY id"
// Test 9: EXACT in boolean queries
- qt_exact_and "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:EXACT(Hello World) AND content:test') ORDER BY id"
- qt_exact_or "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:EXACT(Hello World) OR title:EXACT(hello world)') ORDER BY id"
- qt_exact_not "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('NOT title:EXACT(HELLO WORLD)') ORDER BY id LIMIT 10"
+ qt_exact_and "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:EXACT(Hello World) AND content:test') ORDER BY id"
+ qt_exact_or "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:EXACT(Hello World) OR title:EXACT(hello world)') ORDER BY id"
+ qt_exact_not "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('NOT title:EXACT(HELLO WORLD)') ORDER BY id LIMIT 10"
// Test 10: EXACT with NULL values
sql """INSERT INTO ${tableName} VALUES (10, NULL, 'null title test', 'null', 'null')"""
Thread.sleep(2000)
- qt_exact_null "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:EXACT(NULL)') ORDER BY id"
+ qt_exact_null "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:EXACT(NULL)') ORDER BY id"
// Test 11: Multiple EXACT conditions
- qt_exact_multiple "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, keyword FROM ${tableName} WHERE search('title:EXACT(Hello World) AND keyword:EXACT(test keyword)') ORDER BY id"
+ qt_exact_multiple "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, keyword FROM ${tableName} WHERE search('title:EXACT(Hello World) AND keyword:EXACT(test keyword)') ORDER BY id"
// Test 12: EXACT vs regular term query comparison
- qt_term_query "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:Hello') ORDER BY id"
- qt_exact_query "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:EXACT(Hello)') ORDER BY id"
+ qt_term_query "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:Hello') ORDER BY id"
+ qt_exact_query "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:EXACT(Hello)') ORDER BY id"
// Test 13: EXACT with ALL - combining different operators
- qt_exact_and_all "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${tableName} WHERE search('title:EXACT(Hello World) AND content:ALL(test document)') ORDER BY id"
+ qt_exact_and_all "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${tableName} WHERE search('title:EXACT(Hello World) AND content:ALL(test document)') ORDER BY id"
// Test 14: Case sensitivity without lowercase config
- qt_exact_case_hello "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, keyword FROM ${tableName} WHERE search('keyword:EXACT(hello)') ORDER BY id"
- qt_exact_case_HELLO "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, keyword FROM ${tableName} WHERE search('keyword:EXACT(HELLO)') ORDER BY id"
+ qt_exact_case_hello "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, keyword FROM ${tableName} WHERE search('keyword:EXACT(hello)') ORDER BY id"
+ qt_exact_case_HELLO "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, keyword FROM ${tableName} WHERE search('keyword:EXACT(HELLO)') ORDER BY id"
// Test 15: EXACT on mixed_index should prefer untokenized index
// So it should match exact string, not tokens
- qt_exact_mixed_exact_match "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, mixed_index FROM ${tableName} WHERE search('mixed_index:EXACT(tokenized value)') ORDER BY id"
- qt_any_mixed_token_match "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, mixed_index FROM ${tableName} WHERE search('mixed_index:ALL(tokenized value)') ORDER BY id"
+ qt_exact_mixed_exact_match "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, mixed_index FROM ${tableName} WHERE search('mixed_index:EXACT(tokenized value)') ORDER BY id"
+ qt_any_mixed_token_match "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, mixed_index FROM ${tableName} WHERE search('mixed_index:ALL(tokenized value)') ORDER BY id"
}
diff --git a/regression-test/suites/search/test_search_exact_multi_index.groovy b/regression-test/suites/search/test_search_exact_multi_index.groovy
index ebe22c8e196..b3a48ee9bc1 100644
--- a/regression-test/suites/search/test_search_exact_multi_index.groovy
+++ b/regression-test/suites/search/test_search_exact_multi_index.groovy
@@ -18,8 +18,8 @@
suite("test_search_exact_multi_index", "p0") {
def tableName = "exact_multi_index_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -51,23 +51,23 @@ suite("test_search_exact_multi_index", "p0") {
Thread.sleep(3000)
// Test 1: EXACT should use untokenized index - exact match only
- qt_exact_full_match """SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:EXACT(machine learning)', '{"mode":"standard"}') ORDER BY id"""
+ qt_exact_full_match """SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:EXACT(machine learning)', '{"mode":"standard"}') ORDER BY id"""
// Test 2: EXACT should not match partial tokens
- qt_exact_no_partial """SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:EXACT(machine)', '{"mode":"standard"}') ORDER BY id"""
+ qt_exact_no_partial """SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:EXACT(machine)', '{"mode":"standard"}') ORDER BY id"""
// Test 3: ANY should use tokenized index - matches any token
- qt_any_token_match """SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:ANY(machine learning)', '{"mode":"standard"}') ORDER BY id"""
+ qt_any_token_match """SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:ANY(machine learning)', '{"mode":"standard"}') ORDER BY id"""
// Test 4: ALL should use tokenized index - matches all tokens
- qt_all_token_match """SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:ALL(machine learning)', '{"mode":"standard"}') ORDER BY id"""
+ qt_all_token_match """SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:ALL(machine learning)', '{"mode":"standard"}') ORDER BY id"""
// Test 5: Verify EXACT vs ANY behavior difference
// EXACT: only exact string match
// ANY: any token matches
- qt_exact_strict """SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:EXACT(deep learning)', '{"mode":"standard"}') ORDER BY id"""
- qt_any_loose """SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:ANY(deep learning)', '{"mode":"standard"}') ORDER BY id"""
+ qt_exact_strict """SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:EXACT(deep learning)', '{"mode":"standard"}') ORDER BY id"""
+ qt_any_loose """SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:ANY(deep learning)', '{"mode":"standard"}') ORDER BY id"""
// Test 6: Multiple conditions with EXACT and ANY
- qt_mixed_exact_any """SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:EXACT(machine learning) OR content:ANY(intelligence)', '{"mode":"standard"}') ORDER BY id"""
+ qt_mixed_exact_any """SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, content FROM ${tableName} WHERE search('content:EXACT(machine learning) OR content:ANY(intelligence)', '{"mode":"standard"}') ORDER BY id"""
}
diff --git a/regression-test/suites/search/test_search_field_group_query.groovy b/regression-test/suites/search/test_search_field_group_query.groovy
index b352d6d1cc7..48e1e468ace 100644
--- a/regression-test/suites/search/test_search_field_group_query.groovy
+++ b/regression-test/suites/search/test_search_field_group_query.groovy
@@ -29,10 +29,10 @@
suite("test_search_field_group_query") {
def tableName = "search_field_group_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
// When false, search() expressions are not pushed to the inverted index evaluation
// path, causing "SearchExpr should not be executed without inverted index" errors.
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
diff --git a/regression-test/suites/search/test_search_function.groovy b/regression-test/suites/search/test_search_function.groovy
index 25fb08cef5a..e99c28d253b 100644
--- a/regression-test/suites/search/test_search_function.groovy
+++ b/regression-test/suites/search/test_search_function.groovy
@@ -85,59 +85,59 @@ suite("test_search_function", "p0") {
Thread.sleep(10000)
// Verify data insertion
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableName}"
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${indexTableName}"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableName}"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${indexTableName}"
// Test 1: Basic term search
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('title:Machine') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('title:Machine') ORDER BY id"
// Test 2: Phrase search
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('title:\"Machine Learning\"') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('title:\"Machine Learning\"') ORDER BY id"
// Test 3: Multiple field search with AND
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('title:Learning AND category:Technology') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('title:Learning AND category:Technology') ORDER BY id"
// Test 4: Multiple field search with OR
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('title:Python OR title:Algorithm') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('title:Python OR title:Algorithm') ORDER BY id"
// Test 5: NOT search
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${indexTableName} WHERE search('category:Technology AND NOT title:Machine')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${indexTableName} WHERE search('category:Technology AND NOT title:Machine')"
// Test 6: Complex nested search
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('(title:Learning OR content:algorithms) AND category:Technology') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('(title:Learning OR content:algorithms) AND category:Technology') ORDER BY id"
// Test 7: Wildcard search
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('title:Learn*') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('title:Learn*') ORDER BY id"
// Test 8: Prefix search
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('title:Data*') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('title:Data*') ORDER BY id"
// Test 9: Search in content field
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('content:neural') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('content:neural') ORDER BY id"
// Test 10: Search in tags field
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('tags:programming') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('tags:programming') ORDER BY id"
// Test 11: Case insensitive search
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('title:MACHINE') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('title:MACHINE') ORDER BY id"
// Test 12: Search with spaces in field values
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('content:\"machine learning\"') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('content:\"machine learning\"') ORDER BY id"
// Test 13: Empty search result
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${indexTableName} WHERE search('title:nonexistent')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${indexTableName} WHERE search('title:nonexistent')"
// Test 14: Search combined with other WHERE conditions
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('category:Technology') AND view_count > 1400 ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('category:Technology') AND view_count > 1400 ORDER BY id"
// Test 15: Search with GROUP BY
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ category, COUNT(*) as cnt FROM ${indexTableName} WHERE search('title:Learning OR title:Programming') GROUP BY category ORDER BY category"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ category, COUNT(*) as cnt FROM ${indexTableName} WHERE search('title:Learning OR title:Programming') GROUP BY category ORDER BY category"
// Test 16: Search with ORDER BY
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, view_count FROM ${indexTableName} WHERE search('tags:AI OR tags:programming') ORDER BY view_count DESC"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, view_count FROM ${indexTableName} WHERE search('tags:AI OR tags:programming') ORDER BY view_count DESC"
// Test 17: Search with LIMIT
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('category:Technology') ORDER BY id LIMIT 3"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('category:Technology') ORDER BY id LIMIT 3"
// Test 18: Search function in SELECT clause (should not be allowed - search is a predicate)
// This test is commented out as it expects an exception
@@ -148,10 +148,10 @@ suite("test_search_function", "p0") {
//qt_sql "SELECT id FROM ${indexTableName} WHERE search('title:')"
// Test 20: ANY query test
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('tags:ANY(AI programming)') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('tags:ANY(AI programming)') ORDER BY id"
// Test 21: ALL query test
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('tags:ALL(machine learning)') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${indexTableName} WHERE search('tags:ALL(machine learning)') ORDER BY id"
// Test 22: Search on non-indexed table — must now throw at FE planning time.
// After the fix for Jira CIR-20006, RewriteSearchToSlots refuses to rewrite
@@ -159,7 +159,7 @@ suite("test_search_function", "p0") {
// AnalysisException that names the column and points at "inverted index".
boolean threw = false
try {
- sql """SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:Machine') ORDER BY id"""
+ sql """SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:Machine') ORDER BY id"""
} catch (Exception e) {
threw = true
logger.info(e.getMessage())
diff --git a/regression-test/suites/search/test_search_inverted_index.groovy b/regression-test/suites/search/test_search_inverted_index.groovy
index d4d83384d76..0b3b7f11a3d 100644
--- a/regression-test/suites/search/test_search_inverted_index.groovy
+++ b/regression-test/suites/search/test_search_inverted_index.groovy
@@ -111,52 +111,52 @@ suite("test_search_inverted_index", "p0") {
Thread.sleep(10000)
// Verify data insertion
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex}"
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithoutIndex}"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex}"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithoutIndex}"
// Test 1: Basic search functionality on indexed table
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('title:Machine')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('title:Machine')"
// Test 2: Compare results between indexed and non-indexed tables
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableWithIndex} WHERE search('title:Learning') ORDER BY id"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableWithIndex} WHERE search('title:Learning') ORDER BY id"
//qt_sql "SELECT id FROM ${tableWithoutIndex} WHERE search('title:Learning') ORDER BY id"
// Test 3: Complex search with multiple fields
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('title:Machine AND category:Technology')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('title:Machine AND category:Technology')"
// Test 4: Search with phrase queries
//qt_sql "SELECT COUNT(*) FROM ${tableWithIndex} WHERE search('content:\"comprehensive content\"')"
// Test 5: Search with boolean operators
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('(title:Learning OR title:Guide) AND category:Technology')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('(title:Learning OR title:Guide) AND category:Technology')"
// Test 6: Search with NOT operator
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('NOT title:Machine')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('NOT title:Machine')"
// Test 7: Wildcard searches
//qt_sql "SELECT COUNT(*) FROM ${tableWithIndex} WHERE search('title:Learn*')"
// Test 8: Search in tags field (test tokenized field)
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('tags:tutorial')"
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('tags:devops')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('tags:tutorial')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('tags:devops')"
// Test 9: Search by author
//qt_sql "SELECT COUNT(*) FROM ${tableWithIndex} WHERE search('author:\"John Smith\"')"
// Test 10: Search combined with regular WHERE clauses
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('category:Technology') AND view_count > 3000"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('category:Technology') AND view_count > 3000"
// Test 11: Search with GROUP BY
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ category, COUNT(*) as cnt FROM ${tableWithIndex} WHERE search('title:Learning') GROUP BY category ORDER BY cnt DESC, category ASC"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ category, COUNT(*) as cnt FROM ${tableWithIndex} WHERE search('title:Learning') GROUP BY category ORDER BY cnt DESC, category ASC"
// Test 12: Search with ORDER BY and LIMIT
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableWithIndex} WHERE search('title:Advanced') ORDER BY view_count DESC LIMIT 10"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableWithIndex} WHERE search('title:Advanced') ORDER BY view_count DESC LIMIT 10"
// Test 13: Search with aggregation functions
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ AVG(rating), MAX(view_count), MIN(view_count) FROM ${tableWithIndex} WHERE search('category:Technology')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ AVG(rating), MAX(view_count), MIN(view_count) FROM ${tableWithIndex} WHERE search('category:Technology')"
// Test 14: Search with HAVING clause
qt_sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ category, COUNT(*) as cnt
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ category, COUNT(*) as cnt
FROM ${tableWithIndex}
WHERE search('tags:guide OR tags:tutorial')
GROUP BY category
@@ -166,7 +166,7 @@ suite("test_search_inverted_index", "p0") {
// Test 15: Nested search queries
qt_sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableWithIndex}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableWithIndex}
WHERE search('title:Complete OR title:Advanced')
AND id IN (
SELECT id FROM ${tableWithIndex}
@@ -180,25 +180,25 @@ suite("test_search_inverted_index", "p0") {
//qt_sql "SELECT COUNT(*) FROM ${tableWithIndex} WHERE search('title:\"Complete Guide\"')"
// Edge Case 2: Search with very common terms
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('content:the')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('content:the')"
// Edge Case 3: Search with numeric-like terms
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('content:2023')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('content:2023')"
// Edge Case 4: Case sensitivity test
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('title:MACHINE')"
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('title:machine')"
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('title:Machine')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('title:MACHINE')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('title:machine')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('title:Machine')"
// Index effectiveness test
//qt_sql "SELECT id, title FROM ${tableWithIndex} WHERE search('title:Introduction AND content:\"practical examples\" AND tags:tutorial') ORDER BY view_count DESC LIMIT 100"
// Test ANY query performance
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('tags:ANY(tutorial guide example)')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('tags:ANY(tutorial guide example)')"
// Test ALL query performance
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('tags:ALL(machine learning)')"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ COUNT(*) FROM ${tableWithIndex} WHERE search('tags:ALL(machine learning)')"
// Test complex ANY/ALL combinations
- qt_sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableWithIndex} WHERE search('(tags:ANY(java python) OR tags:ALL(tutorial guide)) AND category:Technology') order by id LIMIT 10"
+ qt_sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableWithIndex} WHERE search('(tags:ANY(java python) OR tags:ALL(tutorial guide)) AND category:Technology') order by id LIMIT 10"
}
diff --git a/regression-test/suites/search/test_search_inverted_index_profile.groovy b/regression-test/suites/search/test_search_inverted_index_profile.groovy
index 6e0b4c92a5e..62426eef9f5 100644
--- a/regression-test/suites/search/test_search_inverted_index_profile.groovy
+++ b/regression-test/suites/search/test_search_inverted_index_profile.groovy
@@ -72,8 +72,7 @@ suite("test_search_inverted_index_profile", "nonConcurrent") {
sql """ set enable_sql_cache = false """
sql """ set enable_inverted_index_searcher_cache = false """
sql """ set enable_inverted_index_query_cache = false """
- sql """ set enable_common_expr_pushdown = true """
- sql """ set enable_common_expr_pushdown_for_inverted_index = true """
+ sql """ set enable_segment_limit_pushdown = true """
def queryId1 = "search_profile_miss_${System.currentTimeMillis()}"
try {
@@ -127,7 +126,7 @@ suite("test_search_inverted_index_profile", "nonConcurrent") {
sql """ set enable_inverted_index_query_cache = false """
// First run: populate searcher cache
- sql """SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */
+ sql """SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */
id FROM ${tableName} WHERE search('title:cherry') ORDER BY id"""
// Second run: should hit searcher cache
@@ -179,16 +178,16 @@ suite("test_search_inverted_index_profile", "nonConcurrent") {
GetDebugPoint().enableDebugPointForAllBEs("FieldReaderResolver.resolve.io_ctx")
// First query: cache miss, debug point validates io_ctx consistency
- qt_io_ctx_miss """ SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */
+ qt_io_ctx_miss """ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */
id FROM ${tableName} WHERE search('content:tropical') ORDER BY id """
// Second query: cache hit, reuses the cached searcher
// If io_ctx was stale, this would crash under ASAN
- qt_io_ctx_hit """ SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */
+ qt_io_ctx_hit """ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */
id FROM ${tableName} WHERE search('content:tropical') ORDER BY id """
// Third query: different DSL but same field — exercises resolver cache
- qt_io_ctx_multi """ SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */
+ qt_io_ctx_multi """ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */
id FROM ${tableName} WHERE search('content:tropical OR content:fruit') ORDER BY id """
} finally {
GetDebugPoint().disableDebugPointForAllBEs("FieldReaderResolver.resolve.io_ctx")
@@ -204,7 +203,7 @@ suite("test_search_inverted_index_profile", "nonConcurrent") {
sql """ set enable_inverted_index_query_cache = true """
// First run: populate DSL cache
- sql """SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */
+ sql """SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */
id FROM ${tableName} WHERE search('title:banana') ORDER BY id"""
// Second run: should hit DSL cache
@@ -251,7 +250,7 @@ suite("test_search_inverted_index_profile", "nonConcurrent") {
sql """ set enable_inverted_index_query_cache = false """
// First run: cache miss (searcher cache disabled, nothing to hit)
- sql """SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */
+ sql """SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */
id FROM ${tableName} WHERE search('title:grape') ORDER BY id"""
// Second run: should STILL be a cache miss because searcher cache is disabled
@@ -291,7 +290,7 @@ suite("test_search_inverted_index_profile", "nonConcurrent") {
// both should return identical results.
// =========================================================================
def search_result = sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */
id FROM ${tableName} WHERE search('title:apple') ORDER BY id
"""
def match_result = sql """
diff --git a/regression-test/suites/search/test_search_inverted_is_null_pushdown.groovy b/regression-test/suites/search/test_search_inverted_is_null_pushdown.groovy
index 8a4eec5f8ea..14fd007e5a5 100644
--- a/regression-test/suites/search/test_search_inverted_is_null_pushdown.groovy
+++ b/regression-test/suites/search/test_search_inverted_is_null_pushdown.groovy
@@ -42,7 +42,7 @@ suite("test_search_inverted_is_null_pushdown", "p0") {
(4, NULL, 'qux', 10)
"""
- sql "SET enable_common_expr_pushdown=true"
+ sql "SET enable_segment_limit_pushdown=true"
sql "SET inverted_index_skip_threshold=0"
def nullBranchQuery = """
diff --git a/regression-test/suites/search/test_search_lucene_mode.groovy b/regression-test/suites/search/test_search_lucene_mode.groovy
index 4a2a5c7d94c..ca5526669a8 100644
--- a/regression-test/suites/search/test_search_lucene_mode.groovy
+++ b/regression-test/suites/search/test_search_lucene_mode.groovy
@@ -33,8 +33,8 @@
suite("test_search_lucene_mode", "p0") {
def tableName = "search_lucene_mode_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -73,7 +73,7 @@ suite("test_search_lucene_mode", "p0") {
// ============ Test 1: Standard mode AND behavior ============
// In standard mode, 'apple AND banana' behaves like boolean AND
qt_standard_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:apple AND title:banana')
ORDER BY id
@@ -83,7 +83,7 @@ suite("test_search_lucene_mode", "p0") {
// In Lucene mode, 'a AND b' marks both as MUST (+a +b)
// Expected same result as standard mode for simple AND
qt_lucene_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('apple AND banana', '{"default_field":"title","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -92,7 +92,7 @@ suite("test_search_lucene_mode", "p0") {
// ============ Test 3: Standard mode OR behavior ============
// In standard mode, 'apple OR date' returns any row matching either
qt_standard_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:apple OR title:date')
ORDER BY id
@@ -101,7 +101,7 @@ suite("test_search_lucene_mode", "p0") {
// ============ Test 4: Lucene mode OR behavior ============
// In Lucene mode, 'a OR b' marks both as SHOULD with minimum_should_match=1
qt_lucene_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('apple OR date', '{"default_field":"title","default_operator":"or","mode":"lucene"}')
ORDER BY id
@@ -117,7 +117,7 @@ suite("test_search_lucene_mode", "p0") {
// So effectively: +apple only
// Expected: rows containing 'apple' -> 1, 2, 3, 8
qt_lucene_complex_and_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('apple AND banana OR cherry', '{"default_field":"title","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -133,7 +133,7 @@ suite("test_search_lucene_mode", "p0") {
// So effectively: apple AND (banana OR cherry)
// Expected: rows with 'apple' AND ('banana' OR 'cherry') -> 1, 2
qt_lucene_min_should_match_1 """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('apple AND banana OR cherry', '{"default_field":"title","default_operator":"and","mode":"lucene","minimum_should_match":1}')
ORDER BY id
@@ -144,7 +144,7 @@ suite("test_search_lucene_mode", "p0") {
// This matches all documents EXCEPT those containing the negated term.
// Expected: all docs without "apple" in title (4, 5, 6, 7)
qt_lucene_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('NOT apple', '{"default_field":"title","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -156,7 +156,7 @@ suite("test_search_lucene_mode", "p0") {
// - 'NOT b' makes 'b' MUST_NOT
// Expected: rows with 'apple' but NOT 'banana'
qt_lucene_and_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('apple AND NOT banana', '{"default_field":"title","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -168,7 +168,7 @@ suite("test_search_lucene_mode", "p0") {
// - 'NOT b' makes 'b' MUST_NOT
// Expected: rows with 'apple' OR (NOT 'banana')
qt_lucene_or_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('apple OR NOT banana', '{"default_field":"title","default_operator":"or","mode":"lucene","minimum_should_match":1}')
ORDER BY id
@@ -178,7 +178,7 @@ suite("test_search_lucene_mode", "p0") {
// 'a OR b OR c' with only SHOULD clauses
// minimum_should_match defaults to 1 (at least one must match)
qt_lucene_or_only """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('apple OR date OR fig', '{"default_field":"title","default_operator":"or","mode":"lucene"}')
ORDER BY id
@@ -187,7 +187,7 @@ suite("test_search_lucene_mode", "p0") {
// ============ Test 11: Lucene mode cross-field query ============
// Multi-field query with Lucene mode
qt_lucene_cross_field """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, category
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, category
FROM ${tableName}
WHERE search('title:apple AND category:fruit', '{"default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -196,7 +196,7 @@ suite("test_search_lucene_mode", "p0") {
// ============ Test 12: Standard mode for comparison ============
// Same query in standard mode for comparison
qt_standard_cross_field """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, category
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, category
FROM ${tableName}
WHERE search('title:apple AND category:fruit')
ORDER BY id
@@ -204,7 +204,7 @@ suite("test_search_lucene_mode", "p0") {
// ============ Test 13: Lucene mode with phrase query ============
qt_lucene_phrase """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('"apple banana"', '{"default_field":"title","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -212,7 +212,7 @@ suite("test_search_lucene_mode", "p0") {
// ============ Test 14: Lucene mode with wildcard ============
qt_lucene_wildcard """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('app* AND ban*', '{"default_field":"title","default_operator":"and","mode":"lucene"}')
ORDER BY id
@@ -221,7 +221,7 @@ suite("test_search_lucene_mode", "p0") {
// ============ Test 15: Verify standard mode unchanged ============
// Ensure standard mode is not affected by the Lucene mode addition
qt_standard_unchanged """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:apple AND title:banana')
ORDER BY id
@@ -229,7 +229,7 @@ suite("test_search_lucene_mode", "p0") {
// ============ Test 16: Lucene mode with empty options (should use standard mode) ============
qt_empty_options """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('apple AND banana', '{"default_field":"title","default_operator":"and"}')
ORDER BY id
@@ -239,7 +239,7 @@ suite("test_search_lucene_mode", "p0") {
// With minimum_should_match=0 (default in filter context), SHOULD clauses are discarded
// when MUST clauses exist
qt_lucene_min_should_match_0 """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('apple AND banana OR date', '{"default_field":"title","default_operator":"and","mode":"lucene","minimum_should_match":0}')
ORDER BY id
diff --git a/regression-test/suites/search/test_search_mow_support.groovy b/regression-test/suites/search/test_search_mow_support.groovy
index 279cc45b1df..8a111f0e75a 100644
--- a/regression-test/suites/search/test_search_mow_support.groovy
+++ b/regression-test/suites/search/test_search_mow_support.groovy
@@ -49,8 +49,8 @@ suite("test_search_mow_support", "p0") {
(4, 'rainbowman lowercase', 'case variants')
"""
- sql "SET enable_common_expr_pushdown = true"
- sql "SET enable_common_expr_pushdown_for_inverted_index = true"
+ sql "SET enable_segment_limit_pushdown = true"
+ sql "SET enable_segment_limit_pushdown = true"
def exactCount = sql """
SELECT /*+SET_VAR(enable_inverted_index_query=true) */ count(*)
diff --git a/regression-test/suites/search/test_search_multi_analyzer_lucene.groovy b/regression-test/suites/search/test_search_multi_analyzer_lucene.groovy
index 2d7657728bb..19be7312834 100644
--- a/regression-test/suites/search/test_search_multi_analyzer_lucene.groovy
+++ b/regression-test/suites/search/test_search_multi_analyzer_lucene.groovy
@@ -28,8 +28,8 @@
suite("test_search_multi_analyzer_lucene") {
def tableName = "search_multi_analyzer_lucene_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -60,7 +60,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 1: Lucene mode TERM query - should use tokenized index
qt_lucene_term """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('hello', '{"default_field":"title", "default_operator":"AND", "mode":"lucene", "minimum_should_match": 0}')
ORDER BY id
@@ -68,7 +68,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 2: Lucene mode AND query
qt_lucene_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('hello AND world', '{"default_field":"title", "default_operator":"AND", "mode":"lucene"}')
ORDER BY id
@@ -76,7 +76,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 3: Lucene mode OR query
qt_lucene_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('hello OR peace', '{"default_field":"title", "default_operator":"OR", "mode":"lucene"}')
ORDER BY id
@@ -84,7 +84,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 4: Lucene mode wildcard query
qt_lucene_wildcard """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('h*llo', '{"default_field":"title", "default_operator":"AND", "mode":"lucene", "minimum_should_match": 0}')
ORDER BY id
@@ -92,7 +92,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 5: Standard mode TERM query (non-lucene) with multi-index
qt_standard_term """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:hello')
ORDER BY id
@@ -100,7 +100,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 6: Standard mode phrase query with multi-index
qt_standard_phrase """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:"hello world"')
ORDER BY id
@@ -108,7 +108,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 7: Lucene mode phrase query with multi-index
qt_lucene_phrase """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('"hello world"', '{"default_field":"title", "default_operator":"AND", "mode":"lucene"}')
ORDER BY id
@@ -116,7 +116,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 8: ANY clause with multi-index
qt_any_multi_index """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:ANY(hello peace)')
ORDER BY id
@@ -124,7 +124,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 9: ALL clause with multi-index
qt_all_multi_index """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:ALL(hello world)')
ORDER BY id
@@ -167,7 +167,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 10: Untokenized wildcard h*llo - no match because full string "hello world" != h*llo
qt_untok_wildcard_no_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${untokTable}
WHERE search('h*llo', '{"default_field":"title", "mode":"lucene"}')
ORDER BY id
@@ -175,7 +175,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 11: Untokenized wildcard hello* - matches full strings starting with "hello"
qt_untok_wildcard_prefix """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${untokTable}
WHERE search('hello*', '{"default_field":"title", "mode":"lucene"}')
ORDER BY id
@@ -183,7 +183,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 12: Untokenized wildcard *world - matches full strings ending with "world"
qt_untok_wildcard_suffix """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${untokTable}
WHERE search('*world', '{"default_field":"title", "mode":"lucene"}')
ORDER BY id
@@ -191,7 +191,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 13: Untokenized PREFIX hel* - matches full strings starting with "hel"
qt_untok_prefix """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${untokTable}
WHERE search('title:hel*', '{"mode":"lucene"}')
ORDER BY id
@@ -199,7 +199,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 14: Untokenized REGEXP hel.* - matches full strings matching regex
qt_untok_regexp """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${untokTable}
WHERE search('title:/hel.*/', '{"mode":"lucene"}')
ORDER BY id
@@ -207,7 +207,7 @@ suite("test_search_multi_analyzer_lucene") {
// Test 15: Untokenized exact phrase match
qt_untok_exact """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${untokTable}
WHERE search('title:"hello world"', '{"mode":"lucene"}')
ORDER BY id
diff --git a/regression-test/suites/search/test_search_multi_field.groovy b/regression-test/suites/search/test_search_multi_field.groovy
index f9f6ab3a42e..fdd5b748c85 100644
--- a/regression-test/suites/search/test_search_multi_field.groovy
+++ b/regression-test/suites/search/test_search_multi_field.groovy
@@ -33,8 +33,8 @@
suite("test_search_multi_field", "p0") {
def tableName = "search_multi_field_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -78,7 +78,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 1: Single term across multiple fields ============
// "machine" in title OR content
qt_multi_field_single_term """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine', '{"mode":"standard","fields":["title","content"]}')
ORDER BY id
@@ -90,7 +90,7 @@ suite("test_search_multi_field", "p0") {
// id=1: title has both terms
// id=9: title has "machine", content has "learning" (cross_fields match)
qt_multi_field_multi_term_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine learning', '{"mode":"standard","fields":["title","content"],"default_operator":"and","type":"cross_fields"}')
ORDER BY id
@@ -100,7 +100,7 @@ suite("test_search_multi_field", "p0") {
// Same as Test 2 but with mode:lucene - should have same result
// Uses cross_fields semantics explicitly
qt_multi_field_multi_term_and_lucene """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine learning', '{"fields":["title","content"],"default_operator":"and","mode":"lucene","type":"cross_fields"}')
ORDER BY id
@@ -108,7 +108,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 3: Multiple terms with OR (default) ============
qt_multi_field_multi_term_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine learning', '{"mode":"standard","fields":["title","content"],"default_operator":"or"}')
ORDER BY id
@@ -117,7 +117,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 4: Explicit AND operator in DSL (cross_fields) ============
// Uses explicit type:cross_fields for backward compatibility
qt_multi_field_explicit_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine AND learning', '{"mode":"standard","fields":["title","content"],"type":"cross_fields"}')
ORDER BY id
@@ -125,7 +125,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 5: Mixed - some terms with explicit field (cross_fields) ============
qt_multi_field_mixed """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, category
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, category
FROM ${tableName}
WHERE search('machine AND category:tech', '{"mode":"standard","fields":["title","content"],"type":"cross_fields"}')
ORDER BY id
@@ -133,7 +133,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 6: Three fields ============
qt_three_fields """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('ai', '{"mode":"standard","fields":["title","content","tags"]}')
ORDER BY id
@@ -141,7 +141,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 7: Wildcard across fields ============
qt_multi_field_wildcard """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('learn*', '{"mode":"standard","fields":["title","content","tags"]}')
ORDER BY id
@@ -149,7 +149,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 8: NOT operator (cross_fields) ============
qt_multi_field_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine AND NOT cooking', '{"mode":"standard","fields":["title","content"],"type":"cross_fields"}')
ORDER BY id
@@ -157,7 +157,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 9: Complex boolean (cross_fields) ============
qt_multi_field_complex """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('(machine OR ai) AND NOT cooking', '{"mode":"standard","fields":["title","content"],"type":"cross_fields"}')
ORDER BY id
@@ -165,7 +165,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 10: Single field in array (backward compatible) ============
qt_single_field_array """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine', '{"mode":"standard","fields":["title"]}')
ORDER BY id
@@ -175,7 +175,7 @@ suite("test_search_multi_field", "p0") {
// This is equivalent to Test 2 but uses Lucene mode with explicit AND operator
// Uses cross_fields semantics explicitly
qt_multi_field_lucene_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine AND learning', '{"fields":["title","content"],"mode":"lucene","minimum_should_match":0,"type":"cross_fields"}')
ORDER BY id
@@ -186,7 +186,7 @@ suite("test_search_multi_field", "p0") {
// Query: "machine AND learning" across title and content
// id=9 has 'machine' in title and 'learning' in content - should match with cross_fields
qt_multi_field_cross_fields_verify """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content
FROM ${tableName}
WHERE search('machine AND learning', '{"mode":"standard","fields":["title","content"],"type":"cross_fields"}')
ORDER BY id
@@ -194,7 +194,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 12: Multi-field with Lucene mode - OR ============
qt_multi_field_lucene_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine OR cooking', '{"fields":["title","content"],"mode":"lucene"}')
ORDER BY id
@@ -203,7 +203,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 13: Multi-field with Lucene mode - AND OR mixed (cross_fields) ============
// With minimum_should_match=0, SHOULD clauses are discarded when MUST exists
qt_multi_field_lucene_and_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine AND learning OR cooking', '{"fields":["title","content"],"mode":"lucene","minimum_should_match":0,"type":"cross_fields"}')
ORDER BY id
@@ -211,7 +211,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 14: Multi-field with Lucene mode - minimum_should_match=1 (cross_fields) ============
qt_multi_field_lucene_min_should_1 """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine AND learning OR cooking', '{"fields":["title","content"],"mode":"lucene","minimum_should_match":1,"type":"cross_fields"}')
ORDER BY id
@@ -219,7 +219,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 15: Multi-field with Lucene mode - AND NOT (cross_fields) ============
qt_multi_field_lucene_and_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine AND NOT maintenance', '{"fields":["title","content"],"mode":"lucene","minimum_should_match":0,"type":"cross_fields"}')
ORDER BY id
@@ -228,7 +228,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 16: Comparison - same query with default_field vs fields ============
// Using default_field (single field)
qt_compare_default_field """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine', '{"mode":"standard","default_field":"title"}')
ORDER BY id
@@ -236,7 +236,7 @@ suite("test_search_multi_field", "p0") {
// Using fields array with single field (should be same as default_field)
qt_compare_fields_single """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine', '{"mode":"standard","fields":["title"]}')
ORDER BY id
@@ -244,7 +244,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 17: EXACT function across fields ============
qt_multi_field_exact """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('EXACT(machine learning)', '{"mode":"standard","fields":["title","content"]}')
ORDER BY id
@@ -252,7 +252,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 18: ANY function across fields ============
qt_multi_field_any """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('ANY(machine cooking)', '{"mode":"standard","fields":["title","content"]}')
ORDER BY id
@@ -263,7 +263,7 @@ suite("test_search_multi_field", "p0") {
// Only id=1 matches: title has both "machine" and "learning"
// id=9 does NOT match: "machine" in title, "learning" in content (different fields)
qt_multi_field_best_fields_default """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine learning', '{"mode":"standard","fields":["title","content"],"default_operator":"and"}')
ORDER BY id
@@ -273,7 +273,7 @@ suite("test_search_multi_field", "p0") {
// With cross_fields, terms can be in DIFFERENT fields
// Both id=1 and id=9 match
qt_multi_field_cross_fields """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine learning', '{"mode":"standard","fields":["title","content"],"default_operator":"and","type":"cross_fields"}')
ORDER BY id
@@ -283,7 +283,7 @@ suite("test_search_multi_field", "p0") {
// In lucene mode, best_fields uses per-clause expansion (matching ES query_string),
// so id=1 and id=9 both match (terms can be across different fields)
qt_multi_field_best_fields_lucene """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine learning', '{"fields":["title","content"],"default_operator":"and","mode":"lucene","type":"best_fields"}')
ORDER BY id
@@ -291,7 +291,7 @@ suite("test_search_multi_field", "p0") {
// ============ Test 22: cross_fields with Lucene mode ============
qt_multi_field_cross_fields_lucene """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('machine learning', '{"fields":["title","content"],"default_operator":"and","mode":"lucene","type":"cross_fields"}')
ORDER BY id
@@ -301,28 +301,28 @@ suite("test_search_multi_field", "p0") {
// Regression test for DORIS-24536: search('*', ...) with multi-field should not error
// "*" is a match-all query that should return all rows
qt_multi_field_match_all_best_fields """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*)
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*)
FROM ${tableName}
WHERE search('*', '{"fields":["title","content"],"type":"best_fields","default_operator":"AND","mode":"lucene","minimum_should_match":0}')
"""
// ============ Test 24: MATCH_ALL_DOCS (*) with cross_fields + lucene mode ============
qt_multi_field_match_all_cross_fields """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*)
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*)
FROM ${tableName}
WHERE search('*', '{"fields":["title","content"],"type":"cross_fields","default_operator":"AND","mode":"lucene","minimum_should_match":0}')
"""
// ============ Test 25: MATCH_ALL_DOCS (*) with single default_field + lucene mode ============
qt_match_all_single_field """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*)
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*)
FROM ${tableName}
WHERE search('*', '{"default_field":"title","default_operator":"AND","mode":"lucene","minimum_should_match":0}')
"""
// ============ Test 26: MATCH_ALL_DOCS (*) with best_fields standard mode (no lucene) ============
qt_multi_field_match_all_standard """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*)
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*)
FROM ${tableName}
WHERE search('*', '{"mode":"standard","fields":["title","content"],"type":"best_fields","default_operator":"AND"}')
"""
diff --git a/regression-test/suites/search/test_search_not_null_bitmap.groovy b/regression-test/suites/search/test_search_not_null_bitmap.groovy
index e15c705bc7b..7812cd19dda 100644
--- a/regression-test/suites/search/test_search_not_null_bitmap.groovy
+++ b/regression-test/suites/search/test_search_not_null_bitmap.groovy
@@ -25,7 +25,7 @@ suite("test_search_not_null_bitmap", "p0") {
def tableName = "search_not_null_bitmap"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -58,26 +58,26 @@ suite("test_search_not_null_bitmap", "p0") {
// Internal NOT via search DSL - must match external NOT
qt_not_internal_ids """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName}
WHERE search('NOT msg:omega')
ORDER BY id
"""
// External NOT via SQL NOT operator (this always worked correctly)
qt_not_external_ids """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName}
WHERE NOT search('msg:omega')
ORDER BY id
"""
// Count must match between internal and external NOT
qt_not_internal_count """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('NOT msg:omega')
"""
qt_not_external_count """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE NOT search('msg:omega')
"""
@@ -113,12 +113,12 @@ suite("test_search_not_null_bitmap", "p0") {
// All NULL rows should be excluded by NOT query
qt_all_null_internal """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${allNullTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${allNullTable}
WHERE search('NOT msg:anything')
"""
qt_all_null_external """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${allNullTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${allNullTable}
WHERE NOT search('msg:anything')
"""
@@ -160,39 +160,39 @@ suite("test_search_not_null_bitmap", "p0") {
// NOT on title field: NULL title rows (id=2,4) should be excluded
qt_mixed_not_title_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${mixedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${mixedTable}
WHERE search('NOT title:hello')
ORDER BY id
"""
qt_mixed_not_title_external """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${mixedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${mixedTable}
WHERE NOT search('title:hello')
ORDER BY id
"""
// NOT on content field: NULL content rows (id=3,4) should be excluded
qt_mixed_not_content_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${mixedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${mixedTable}
WHERE search('NOT content:morning')
ORDER BY id
"""
qt_mixed_not_content_external """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${mixedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${mixedTable}
WHERE NOT search('content:morning')
ORDER BY id
"""
// Complex: (title:hello OR content:good) AND NOT title:goodbye
qt_mixed_complex_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${mixedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${mixedTable}
WHERE search('(title:hello OR content:good) AND NOT title:goodbye')
ORDER BY id
"""
qt_mixed_complex_external """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${mixedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${mixedTable}
WHERE (search('title:hello') OR search('content:good'))
AND NOT search('title:goodbye')
ORDER BY id
@@ -203,13 +203,13 @@ suite("test_search_not_null_bitmap", "p0") {
// ---------------------------------------------------------------
qt_multi_must_not_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${mixedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${mixedTable}
WHERE search('NOT title:hello AND NOT title:goodbye')
ORDER BY id
"""
qt_multi_must_not_external """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${mixedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${mixedTable}
WHERE NOT search('title:hello')
AND NOT search('title:goodbye')
ORDER BY id
diff --git a/regression-test/suites/search/test_search_null_regression.groovy b/regression-test/suites/search/test_search_null_regression.groovy
index dc5dc4e4215..0ce97ac7c78 100644
--- a/regression-test/suites/search/test_search_null_regression.groovy
+++ b/regression-test/suites/search/test_search_null_regression.groovy
@@ -18,8 +18,8 @@
suite("test_search_null_regression", "p0") {
def tableName = "search_null_regression_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -71,24 +71,24 @@ suite("test_search_null_regression", "p0") {
// This reproduces the original bug: search('title:"Ronald" or (content:ALL("Selma Blair"))', '{"mode":"standard"}')
// vs title match "Ronald" or (content match_all "Selma Blair")
qt_regression_1_search_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('title:Ronald OR (content:ALL(Selma Blair))', '{"mode":"standard"}')
"""
qt_regression_1_match_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE title match "Ronald" or (content match_all "Selma Blair")
"""
// Detailed verification - get actual matching rows for OR query
qt_regression_1_search_or_rows """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${tableName}
WHERE search('title:Ronald OR (content:ALL(Selma Blair))', '{"mode":"standard"}')
ORDER BY id
"""
qt_regression_1_match_or_rows """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${tableName}
WHERE title match "Ronald" or (content match_all "Selma Blair")
ORDER BY id
"""
@@ -96,24 +96,24 @@ suite("test_search_null_regression", "p0") {
// Regression Test 2: Original Issue - NOT Query Inconsistency
// This reproduces: search('not content:"Round"', '{"mode":"standard"}') vs not search('content:"Round"', '{"mode":"standard"}')
qt_regression_2_internal_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('NOT content:Round', '{"mode":"standard"}')
"""
qt_regression_2_external_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE not search('content:Round', '{"mode":"standard"}')
"""
// Detailed verification for NOT query
qt_regression_2_internal_not_rows """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${tableName}
WHERE search('NOT content:Round', '{"mode":"standard"}')
ORDER BY id
"""
qt_regression_2_external_not_rows """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${tableName}
WHERE not search('content:Round', '{"mode":"standard"}')
ORDER BY id
"""
@@ -121,73 +121,73 @@ suite("test_search_null_regression", "p0") {
// Regression Test 3: NULL Handling in OR Queries
// Verify that OR queries properly handle NULL values according to SQL semantics
qt_regression_3_null_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName}
WHERE search('title:NonExistent OR content:Ronald', '{"mode":"standard"}')
ORDER BY id
"""
// Test with match function for comparison
qt_regression_3_match_null_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName}
WHERE title match "NonExistent" or content match "Ronald"
ORDER BY id
"""
// Regression Test 4: NULL Handling in AND Queries
qt_regression_4_null_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName}
WHERE search('title:Ronald AND content:biography', '{"mode":"standard"}')
ORDER BY id
"""
// Regression Test 5: Complex Boolean Operations
qt_regression_5_complex_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('(title:Ronald OR content:Selma) AND NOT content:Round', '{"mode":"standard"}')
"""
qt_regression_5_complex_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE (title match "Ronald" or content match "Selma") and not search('content:"Round"', '{"mode":"standard"}')
"""
// Regression Test 6: Edge Case - All NULL Query
qt_regression_6_all_null """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('title:NonExistent AND content:NonExistent', '{"mode":"standard"}')
"""
// Regression Test 7: Case Sensitivity and Variations
qt_regression_7_case_lower """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('content:round', '{"mode":"standard"}')
"""
qt_regression_7_case_upper """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('content:Round', '{"mode":"standard"}')
"""
// Regression Test 8: Multiple NOT operations
qt_regression_8_multiple_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('NOT (title:nonexistent OR content:nonexistent)', '{"mode":"standard"}')
"""
qt_regression_8_external_multiple_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE not search('title:nonexistent OR content:nonexistent', '{"mode":"standard"}')
"""
// Regression Test 9: Empty string handling
qt_regression_9_empty_string """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('title:"" OR content:Round', '{"mode":"standard"}')
"""
// Regression Test 10: Performance test with complex query
qt_regression_10_performance """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('(title:Ronald OR title:Selma OR content:Round) AND NOT (title:NonExistent AND content:NonExistent)', '{"mode":"standard"}')
"""
}
\ No newline at end of file
diff --git a/regression-test/suites/search/test_search_null_semantics.groovy b/regression-test/suites/search/test_search_null_semantics.groovy
index 2003c2d4c50..98426816c4d 100644
--- a/regression-test/suites/search/test_search_null_semantics.groovy
+++ b/regression-test/suites/search/test_search_null_semantics.groovy
@@ -18,8 +18,8 @@
suite("test_search_null_semantics", "p0") {
def tableName = "search_null_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -63,30 +63,30 @@ suite("test_search_null_semantics", "p0") {
// search('title:"Ronald" or (content:ALL("Selma Blair"))', '{"mode":"standard"}') should match
// title match "Ronald" or (content match_all "Selma Blair")
qt_test_case_1_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('title:Ronald OR (content:ALL(Selma Blair))', '{"mode":"standard"}')
"""
qt_test_case_1_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE title match "Ronald" or (content match_all "Selma Blair")
"""
// Test Case 2: NOT query consistency - Original Issue Reproduction
// search('not content:"Round"', '{"mode":"standard"}') should match not search('content:"Round"', '{"mode":"standard"}')
qt_test_case_2_internal_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('NOT content:Round', '{"mode":"standard"}')
"""
qt_test_case_2_external_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE not search('content:Round', '{"mode":"standard"}')
"""
// Test Case 2b: Phrase NOT queries must treat NULL rows as UNKNOWN
qt_test_case_2_phrase_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName}
WHERE NOT search('content:"Selma Blair"', '{"mode":"standard"}')
ORDER BY id
"""
@@ -94,7 +94,7 @@ suite("test_search_null_semantics", "p0") {
// Test Case 3: NULL handling in OR queries
// Verify that NULL OR TRUE = TRUE logic works
qt_test_case_3_or_with_null """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${tableName}
WHERE search('title:Ronald OR content:biography', '{"mode":"standard"}')
ORDER BY id
"""
@@ -102,42 +102,42 @@ suite("test_search_null_semantics", "p0") {
// Test Case 4: NULL handling in AND queries
// Verify that NULL AND TRUE = NULL logic works
qt_test_case_4_and_with_null """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${tableName}
WHERE search('title:Ronald AND content:biography', '{"mode":"standard"}')
ORDER BY id
"""
// Test Case 5: Complex OR query with multiple NULL scenarios
qt_test_case_5_complex_or_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('title:Unknown OR content:mascot OR category:Test', '{"mode":"standard"}')
"""
qt_test_case_5_complex_or_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE title match "Unknown" or content match "mascot" or category match "Test"
"""
// Test Case 6: NOT query with different field types
qt_test_case_6_not_title_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('NOT title:Ronald', '{"mode":"standard"}')
"""
qt_test_case_6_not_title_external """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE not search('title:Ronald', '{"mode":"standard"}')
"""
// Test Case 7: Mixed boolean operations
qt_test_case_7_mixed """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('(title:Ronald OR content:Selma) AND NOT category:Unknown', '{"mode":"standard"}')
"""
// Test Case 8: Edge case - all NULL fields
qt_test_case_8_all_null """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('title:NonExistent OR content:NonExistent OR category:NonExistent', '{"mode":"standard"}')
"""
@@ -205,69 +205,69 @@ suite("test_search_null_semantics", "p0") {
Thread.sleep(10000)
qt_nested_1_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${nestedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${nestedTable}
WHERE search('(field_a:alpha OR field_b:beta) AND (field_c:gamma OR field_d:delta)', '{"mode":"standard"}')
"""
qt_nested_1_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${nestedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${nestedTable}
WHERE (field_a match "alpha" OR field_b match "beta") AND (field_c match "gamma" OR field_d match "delta")
"""
qt_nested_1_rows """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, field_a, field_b, field_c, field_d
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, field_a, field_b, field_c, field_d
FROM ${nestedTable}
WHERE search('(field_a:alpha OR field_b:beta) AND (field_c:gamma OR field_d:delta)', '{"mode":"standard"}')
ORDER BY id
"""
qt_nested_2_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${nestedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${nestedTable}
WHERE search('field_a:target OR (field_b:beta AND (field_c:gamma OR field_d:delta))', '{"mode":"standard"}')
"""
qt_nested_2_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${nestedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${nestedTable}
WHERE field_a match "target" OR (field_b match "beta" AND (field_c match "gamma" OR field_d match "delta"))
"""
qt_nested_3_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${nestedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${nestedTable}
WHERE search('NOT (field_a:forbidden OR field_b:forbidden)', '{"mode":"standard"}')
"""
qt_nested_3_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${nestedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${nestedTable}
WHERE NOT (field_a match "forbidden" OR field_b match "forbidden")
"""
qt_nested_4_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${nestedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${nestedTable}
WHERE search('(field_a:alpha OR field_b:beta) AND NOT (field_c:exclude OR field_d:exclude)', '{"mode":"standard"}')
"""
qt_nested_4_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${nestedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${nestedTable}
WHERE (field_a match "alpha" OR field_b match "beta") AND NOT (field_c match "exclude" OR field_d match "exclude")
"""
qt_nested_5_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${nestedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${nestedTable}
WHERE search('field_a:alpha OR field_b:beta OR field_c:gamma OR field_d:delta', '{"mode":"standard"}')
"""
qt_nested_5_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${nestedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${nestedTable}
WHERE field_a match "alpha" OR field_b match "beta" OR field_c match "gamma" OR field_d match "delta"
"""
qt_nested_6_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${nestedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${nestedTable}
WHERE search('field_a:alpha AND (field_b:beta OR (field_c:gamma AND field_d:delta))', '{"mode":"standard"}')
"""
qt_nested_6_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${nestedTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${nestedTable}
WHERE field_a match "alpha" AND (field_b match "beta" OR (field_c match "gamma" AND field_d match "delta"))
"""
@@ -327,79 +327,79 @@ suite("test_search_null_semantics", "p0") {
Thread.sleep(10000)
qt_ternary_1_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${ternaryTable}
WHERE search('title:Ronald OR content:Selma', '{"mode":"standard"}')
"""
qt_ternary_1_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${ternaryTable}
WHERE title match "Ronald" OR content match "Selma"
"""
qt_ternary_1_search_rows """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content, category FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content, category FROM ${ternaryTable}
WHERE search('title:Ronald OR content:Selma', '{"mode":"standard"}')
ORDER BY id
"""
qt_ternary_1_match_rows """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content, category FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content, category FROM ${ternaryTable}
WHERE title match "Ronald" OR content match "Selma"
ORDER BY id
"""
qt_ternary_2_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${ternaryTable}
WHERE search('title:Ronald AND category:politics', '{"mode":"standard"}')
"""
qt_ternary_2_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${ternaryTable}
WHERE title match "Ronald" AND category match "politics"
"""
qt_ternary_3_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${ternaryTable}
WHERE search('NOT content:spam', '{"mode":"standard"}')
"""
qt_ternary_3_external """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${ternaryTable}
WHERE NOT search('content:spam', '{"mode":"standard"}')
"""
qt_ternary_4_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${ternaryTable}
WHERE search('title:Ronald OR content:Selma OR category:biography', '{"mode":"standard"}')
"""
qt_ternary_4_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${ternaryTable}
WHERE title match "Ronald" OR content match "Selma" OR category match "biography"
"""
qt_ternary_5_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${ternaryTable}
WHERE search('(title:Ronald OR content:Selma) AND category:politics', '{"mode":"standard"}')
"""
qt_ternary_5_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${ternaryTable}
WHERE (title match "Ronald" OR content match "Selma") AND category match "politics"
"""
qt_ternary_6_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${ternaryTable}
WHERE search('title:Ronald OR NOT content:spam', '{"mode":"standard"}')
"""
qt_ternary_6_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${ternaryTable}
WHERE title match "Ronald" OR NOT content match "spam"
"""
qt_ternary_7_all_null """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${ternaryTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${ternaryTable}
WHERE search('title:NonExistent OR content:NonExistent OR category:NonExistent', '{"mode":"standard"}')
"""
diff --git a/regression-test/suites/search/test_search_regexp_lowercase.groovy b/regression-test/suites/search/test_search_regexp_lowercase.groovy
index 81b93d0de7d..09c46a51738 100644
--- a/regression-test/suites/search/test_search_regexp_lowercase.groovy
+++ b/regression-test/suites/search/test_search_regexp_lowercase.groovy
@@ -22,8 +22,8 @@
suite("test_search_regexp_lowercase", "p0") {
def tableName = "search_regexp_lowercase_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -56,14 +56,14 @@ suite("test_search_regexp_lowercase", "p0") {
// search() REGEXP with uppercase pattern - should return 0 rows
// because indexed terms are lowercased (abc, def) but pattern AB.* is case-sensitive
qt_regexp_uppercase_no_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ * FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ * FROM ${tableName}
WHERE search('/AB.*/', '{"default_field":"title","default_operator":"AND","mode":"lucene", "minimum_should_match": 0}')
ORDER BY a
"""
// match_regexp with uppercase pattern - should also return 0 rows
qt_match_regexp_uppercase_no_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ * FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ * FROM ${tableName}
WHERE title match_regexp 'AB.*'
ORDER BY a
"""
@@ -74,14 +74,14 @@ suite("test_search_regexp_lowercase", "p0") {
// search() REGEXP with lowercase pattern - should match both rows with "abc"
qt_regexp_lowercase_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ * FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ * FROM ${tableName}
WHERE search('/ab.*/', '{"default_field":"title","default_operator":"AND","mode":"lucene", "minimum_should_match": 0}')
ORDER BY a
"""
// match_regexp with lowercase pattern - should also match
qt_match_regexp_lowercase_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ * FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ * FROM ${tableName}
WHERE title match_regexp 'ab.*'
ORDER BY a
"""
@@ -92,14 +92,14 @@ suite("test_search_regexp_lowercase", "p0") {
// search() WILDCARD with uppercase - should match because wildcard patterns are lowercased
qt_wildcard_uppercase_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ * FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ * FROM ${tableName}
WHERE search('AB*', '{"default_field":"title","default_operator":"AND","mode":"lucene", "minimum_should_match": 0}')
ORDER BY a
"""
// search() WILDCARD with lowercase - should also match
qt_wildcard_lowercase_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ * FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ * FROM ${tableName}
WHERE search('ab*', '{"default_field":"title","default_operator":"AND","mode":"lucene", "minimum_should_match": 0}')
ORDER BY a
"""
@@ -110,14 +110,14 @@ suite("test_search_regexp_lowercase", "p0") {
// Lowercase regex that matches "apple" - should match rows 3 and 4
qt_regexp_apple_lowercase """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ * FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ * FROM ${tableName}
WHERE search('/app.*/', '{"default_field":"title","default_operator":"AND","mode":"lucene", "minimum_should_match": 0}')
ORDER BY a
"""
// Uppercase regex "App.*" should NOT match (terms are lowercased as "apple")
qt_regexp_apple_uppercase_no_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ * FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ * FROM ${tableName}
WHERE search('/App.*/', '{"default_field":"title","default_operator":"AND","mode":"lucene", "minimum_should_match": 0}')
ORDER BY a
"""
@@ -128,26 +128,26 @@ suite("test_search_regexp_lowercase", "p0") {
// Both should return same results for lowercase pattern
qt_consistency_regexp_cherry """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ a FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ a FROM ${tableName}
WHERE search('/cher.*/', '{"default_field":"title","default_operator":"AND","mode":"lucene", "minimum_should_match": 0}')
ORDER BY a
"""
qt_consistency_match_regexp_cherry """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ a FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ a FROM ${tableName}
WHERE title match_regexp 'cher.*'
ORDER BY a
"""
// Both should return 0 rows for uppercase pattern
qt_consistency_regexp_cherry_upper """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ a FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ a FROM ${tableName}
WHERE search('/CHER.*/', '{"default_field":"title","default_operator":"AND","mode":"lucene", "minimum_should_match": 0}')
ORDER BY a
"""
qt_consistency_match_regexp_cherry_upper """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ a FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ a FROM ${tableName}
WHERE title match_regexp 'CHER.*'
ORDER BY a
"""
diff --git a/regression-test/suites/search/test_search_slash_in_term.groovy b/regression-test/suites/search/test_search_slash_in_term.groovy
index 0749929f252..deefa5d1c23 100644
--- a/regression-test/suites/search/test_search_slash_in_term.groovy
+++ b/regression-test/suites/search/test_search_slash_in_term.groovy
@@ -31,7 +31,7 @@
suite("test_search_slash_in_term", "p0") {
def tableName = "search_slash_in_term_test"
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -61,11 +61,18 @@ suite("test_search_slash_in_term", "p0") {
// Wait for index building
Thread.sleep(3000)
+ order_qt_segment_limit_disabled_still_pushes_search """
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=false) */ id
+ FROM ${tableName}
+ WHERE search('title:AC/DC')
+ ORDER BY id
+ """
+
// ============ Test 1: Slash in term with field prefix ============
// title:AC/DC should parse as single term, standard analyzer tokenizes to "ac" and "dc"
// With default OR operator, matches rows containing "ac" or "dc" in title
order_qt_slash_in_term """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:AC/DC')
ORDER BY id
@@ -75,7 +82,7 @@ suite("test_search_slash_in_term", "p0") {
// title:AC\/DC should produce the same result as title:AC/DC
// Groovy: \\\\/ -> SQL: \\/ -> DSL: \/ -> unescaped: /
order_qt_escaped_slash_in_term """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:AC\\\\/DC')
ORDER BY id
@@ -84,7 +91,7 @@ suite("test_search_slash_in_term", "p0") {
// ============ Test 3: Slash in term with default_field (lucene mode) ============
// Bare AC/DC with default_field should work
order_qt_slash_bare_lucene """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('AC/DC', '{"default_field":"title","default_operator":"OR","minimum_should_match":0}')
ORDER BY id
@@ -92,7 +99,7 @@ suite("test_search_slash_in_term", "p0") {
// ============ Test 4: Escaped slash with default_field should match ============
order_qt_escaped_slash_bare_lucene """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('AC\\\\/DC', '{"default_field":"title","default_operator":"OR","minimum_should_match":0}')
ORDER BY id
@@ -100,7 +107,7 @@ suite("test_search_slash_in_term", "p0") {
// ============ Test 5: Multiple slashes in term ============
order_qt_multi_slash """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:path/to/file')
ORDER BY id
@@ -109,7 +116,7 @@ suite("test_search_slash_in_term", "p0") {
// ============ Test 6: Regex pattern still works ============
// /[a-z]+/ should be parsed as regex, not as term with slashes
order_qt_regex_still_works """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('title:/rock/')
ORDER BY id
@@ -117,7 +124,7 @@ suite("test_search_slash_in_term", "p0") {
// ============ Test 7: Slash in term with standard mode ============
order_qt_slash_standard_mode """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title
FROM ${tableName}
WHERE search('AC/DC', '{"default_field":"title","mode":"standard"}')
ORDER BY id
diff --git a/regression-test/suites/search/test_search_usage_restrictions.groovy b/regression-test/suites/search/test_search_usage_restrictions.groovy
index 842fa5454ad..de510db6ad2 100644
--- a/regression-test/suites/search/test_search_usage_restrictions.groovy
+++ b/regression-test/suites/search/test_search_usage_restrictions.groovy
@@ -70,53 +70,53 @@ suite("test_search_usage_restrictions", "p0") {
// ============ Valid Usage Tests ============
// Test 1: search() in WHERE clause is allowed
- qt_valid_where "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:Learning') ORDER BY id"
+ qt_valid_where "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} WHERE search('title:Learning') ORDER BY id"
// Test 2: search() with AND/OR in WHERE is allowed
- qt_valid_where_complex "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('title:Learning') AND id > 1 ORDER BY id"
+ qt_valid_where_complex "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('title:Learning') AND id > 1 ORDER BY id"
// Test 3: Multiple search() in WHERE is allowed
- qt_valid_multiple_search "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('title:Learning') OR search('content:tutorial') ORDER BY id"
+ qt_valid_multiple_search "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('title:Learning') OR search('content:tutorial') ORDER BY id"
// Test 4: search() with LIMIT is allowed
- qt_valid_with_limit "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('title:Learning') LIMIT 2"
+ qt_valid_with_limit "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('title:Learning') LIMIT 2"
// ============ Invalid Usage Tests - Should Fail ============
// Test 5: search() in GROUP BY should fail
test {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName} GROUP BY search('title:Learning')"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName} GROUP BY search('title:Learning')"
exception "predicates are only supported inside WHERE filters on single-table scans"
}
// Test 6: search() in SELECT then GROUP BY alias should fail
test {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ search('title:Learning') as s, count(*) FROM ${tableName} GROUP BY s"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ search('title:Learning') as s, count(*) FROM ${tableName} GROUP BY s"
exception "search()"
}
// Test 7: search() in SELECT projection (without WHERE) should fail
test {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ search('title:Learning'), title FROM ${tableName}"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ search('title:Learning'), title FROM ${tableName}"
exception "search()"
}
// Test 8: search() in aggregate output should fail
test {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(search('title:Learning')) FROM ${tableName}"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(search('title:Learning')) FROM ${tableName}"
exception "search()"
}
// Test 9: search() in HAVING clause should fail
test {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ category, count(*) FROM ${tableName} GROUP BY category HAVING search('title:Learning')"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ category, count(*) FROM ${tableName} GROUP BY category HAVING search('title:Learning')"
exception "predicates are only supported inside WHERE filters on single-table scans"
}
// Test 10: search() with JOIN should fail (not single table)
test {
sql """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ t1.id FROM ${tableName} t1
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ t1.id FROM ${tableName} t1
JOIN ${tableName2} t2 ON t1.id = t2.id
WHERE search('title:Learning')
"""
@@ -125,25 +125,25 @@ suite("test_search_usage_restrictions", "p0") {
// Test 11: search() in ORDER BY should fail
test {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title FROM ${tableName} ORDER BY search('title:Learning')"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title FROM ${tableName} ORDER BY search('title:Learning')"
exception "search()"
}
// Test 12: search() in CASE WHEN (outside WHERE) should fail
test {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ CASE WHEN search('title:Learning') THEN 1 ELSE 0 END FROM ${tableName}"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ CASE WHEN search('title:Learning') THEN 1 ELSE 0 END FROM ${tableName}"
exception "search()"
}
// Test 13: search() in aggregate function context should fail
test {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ max(search('title:Learning')) FROM ${tableName}"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ max(search('title:Learning')) FROM ${tableName}"
exception "search()"
}
// Test 14: search() in window function should fail
test {
- sql "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, row_number() OVER (ORDER BY search('title:Learning')) FROM ${tableName}"
+ sql "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, row_number() OVER (ORDER BY search('title:Learning')) FROM ${tableName}"
exception "search()"
}
@@ -151,24 +151,24 @@ suite("test_search_usage_restrictions", "p0") {
// Test 15: search() in subquery WHERE is allowed (subquery is single table)
qt_valid_subquery """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ * FROM (
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ * FROM (
SELECT id, title FROM ${tableName} WHERE search('title:Learning')
) t WHERE id > 1 ORDER BY id
"""
// Test 16: Multiple fields in search() DSL is allowed
- qt_valid_multi_field "SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('title:Learning AND content:tutorial') ORDER BY id"
+ qt_valid_multi_field "SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('title:Learning AND content:tutorial') ORDER BY id"
// Test 17: search() with complex boolean logic in WHERE is allowed
qt_valid_complex_where """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName}
WHERE (search('title:Learning') OR id = 1) AND category = 'Technology'
ORDER BY id
"""
// Test 18: search() in UNION queries (each part valid) should work
qt_valid_union """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${tableName} WHERE search('title:Learning')
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${tableName} WHERE search('title:Learning')
UNION ALL
SELECT id FROM ${tableName} WHERE search('content:tutorial')
ORDER BY id
diff --git a/regression-test/suites/search/test_search_variant_dual_index_reader.groovy b/regression-test/suites/search/test_search_variant_dual_index_reader.groovy
index e7a83622633..c4870e3a962 100644
--- a/regression-test/suites/search/test_search_variant_dual_index_reader.groovy
+++ b/regression-test/suites/search/test_search_variant_dual_index_reader.groovy
@@ -37,7 +37,7 @@ suite("test_search_variant_dual_index_reader", "p0") {
def tableName = "test_variant_dual_index_reader"
sql """ set enable_match_without_inverted_index = false """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ set default_variant_enable_typed_paths_to_sparse = false """
sql """ set default_variant_enable_doc_mode = false """
sql """ set default_variant_max_subcolumns_count = 2048 """
@@ -87,7 +87,7 @@ suite("test_search_variant_dual_index_reader", "p0") {
// Before fix: returns empty because EQUAL_QUERY selects STRING_TYPE reader.
// After fix: returns rows 1, 3 because MATCH_ANY_QUERY selects FULLTEXT reader.
qt_dual_index_basic """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('admin', '{"default_field":"props.string_8","mode":"lucene"}')
ORDER BY id
"""
@@ -95,7 +95,7 @@ suite("test_search_variant_dual_index_reader", "p0") {
// Test 2: Multi-term AND search. Both "admin" and "access" must match.
// Before fix: empty. After fix: row 3.
qt_dual_index_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('admin access', '{"default_field":"props.string_8","mode":"lucene","default_operator":"AND"}')
ORDER BY id
"""
@@ -103,14 +103,14 @@ suite("test_search_variant_dual_index_reader", "p0") {
// Test 3: Search on a different subcolumn matching the same field_pattern.
// Ensures the fix works across different subcolumns under the same pattern.
qt_dual_index_other_field """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('hello', '{"default_field":"props.string_1","mode":"lucene"}')
ORDER BY id
"""
// Test 4: Field-qualified syntax with dual indexes.
qt_dual_index_field_syntax """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('props.string_8:access', '{"mode":"lucene"}')
ORDER BY id
"""
@@ -118,7 +118,7 @@ suite("test_search_variant_dual_index_reader", "p0") {
// Test 5: Case-insensitive search (lowercase index).
// "ADMIN" should match "admin user" and "admin access granted".
qt_dual_index_case_insensitive """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('ADMIN', '{"default_field":"props.string_8","mode":"lucene"}')
ORDER BY id
"""
@@ -126,7 +126,7 @@ suite("test_search_variant_dual_index_reader", "p0") {
// Test 6: Verify MATCH_ANY also works as baseline (uses MATCH query type directly,
// so it always picks FULLTEXT reader — this should work both before and after the fix).
qt_dual_index_match_baseline """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE props['string_8'] MATCH_ANY 'admin'
ORDER BY id
"""
diff --git a/regression-test/suites/search/test_search_variant_subcolumn_analyzer.groovy b/regression-test/suites/search/test_search_variant_subcolumn_analyzer.groovy
index e5fe758102d..de5a99aef49 100644
--- a/regression-test/suites/search/test_search_variant_subcolumn_analyzer.groovy
+++ b/regression-test/suites/search/test_search_variant_subcolumn_analyzer.groovy
@@ -32,7 +32,7 @@ suite("test_search_variant_subcolumn_analyzer", "p0") {
def tableName = "test_variant_subcolumn_analyzer"
sql """ set enable_match_without_inverted_index = false """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ set default_variant_enable_typed_paths_to_sparse = false """
sql """ set default_variant_enable_doc_mode = false """
sql """ set default_variant_max_subcolumns_count = 2048 """
@@ -79,49 +79,49 @@ suite("test_search_variant_subcolumn_analyzer", "p0") {
// "admin" should match "admin only" and "admin access granted" because the unicode
// parser tokenizes them into ["admin", "only"] and ["admin", "access", "granted"]
qt_search_variant_analyzer_basic """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('admin', '{"default_field":"data.string_8","mode":"lucene"}')
ORDER BY id
"""
// Test 2: Verify MATCH also works (as a baseline)
qt_match_variant_baseline """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE data['string_8'] MATCH_ANY 'admin'
ORDER BY id
"""
// Test 3: Multi-term search should also work with tokenization
qt_search_variant_analyzer_multi """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('admin access', '{"default_field":"data.string_8","mode":"lucene","default_operator":"AND"}')
ORDER BY id
"""
// Test 4: Search on a different subcolumn matching the same field_pattern
qt_search_variant_analyzer_other_field """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('hello', '{"default_field":"data.string_1","mode":"lucene"}')
ORDER BY id
"""
// Test 5: Search with field-qualified syntax on variant subcolumn
qt_search_variant_analyzer_field_syntax """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('data.string_8:user', '{"mode":"lucene"}')
ORDER BY id
"""
// Test 6: Verify lowercase is applied (search for "ADMIN" should match "admin only")
qt_search_variant_analyzer_lowercase """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('ADMIN', '{"default_field":"data.string_8","mode":"lucene"}')
ORDER BY id
"""
// Test 7: Phrase search on variant subcolumn with analyzer
qt_search_variant_analyzer_phrase """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('"admin only"', '{"default_field":"data.string_8","mode":"lucene"}')
ORDER BY id
"""
@@ -166,7 +166,7 @@ suite("test_search_variant_subcolumn_analyzer", "p0") {
// Test 8: search() on variant subcolumn with named field_pattern (direct match)
qt_search_variant_direct_index """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName2}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName2}
WHERE search('admin', '{"default_field":"data.name","mode":"lucene"}')
ORDER BY id
"""
diff --git a/regression-test/suites/search/test_search_variant_wildcard.groovy b/regression-test/suites/search/test_search_variant_wildcard.groovy
index b98a8413c13..16f267655db 100644
--- a/regression-test/suites/search/test_search_variant_wildcard.groovy
+++ b/regression-test/suites/search/test_search_variant_wildcard.groovy
@@ -34,7 +34,7 @@ suite("test_search_variant_wildcard", "p0") {
def tableName = "test_search_variant_wildcard"
sql """ set enable_match_without_inverted_index = false """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ set default_variant_enable_typed_paths_to_sparse = false """
sql """ set default_variant_enable_doc_mode = false """
sql """ set default_variant_max_subcolumns_count = 2048 """
@@ -78,21 +78,21 @@ suite("test_search_variant_wildcard", "p0") {
// Test 1: TERM search for 'smith' on lastname - should return John Smith
qt_term_smith """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('smith', '{"default_field":"props.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY id
"""
// Test 2: TERM search for 'smithson' on lastname - should return Jane Smithson
qt_term_smithson """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('smithson', '{"default_field":"props.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY id
"""
// Test 3: TERM search for 'johnson' on lastname - should return Michael David Johnson
qt_term_johnson """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('johnson', '{"default_field":"props.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY id
"""
@@ -101,63 +101,63 @@ suite("test_search_variant_wildcard", "p0") {
// Test 4: Leading wildcard '*ith' - should match "Smith" (ends with "ith")
qt_wildcard_star_ith """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('*ith', '{"default_field":"props.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY id
"""
// Test 5: Middle wildcard 'sm*th' - should match "Smith"
qt_wildcard_sm_star_th """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('sm*th', '{"default_field":"props.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY id
"""
// Test 6: Single char wildcard 'sm?th' - should match "Smith"
qt_wildcard_sm_q_th """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('sm?th', '{"default_field":"props.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY id
"""
// Test 7: Trailing wildcard 'smith*' - should match "Smith" and "Smithson"
qt_wildcard_smith_star """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('smith*', '{"default_field":"props.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY id
"""
// Test 8: Wildcard 'sm*' - should match "Smith" and "Smithson"
qt_wildcard_sm_star """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('sm*', '{"default_field":"props.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY id
"""
// Test 9: Wildcard '*son' - should match "Smithson" and "Johnson"
qt_wildcard_star_son """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('*son', '{"default_field":"props.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY id
"""
// Test 10: Wildcard on firstname field 'jo?n' - should match "John"
qt_wildcard_firstname """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('jo?n', '{"default_field":"props.string_8","default_operator":"and","mode":"lucene"}')
ORDER BY id
"""
// Test 11: Wildcard combined with AND - 'sm*th AND props.string_8:john'
qt_wildcard_and_term """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('props.string_17:sm*th AND props.string_8:john', '{"default_operator":"and","mode":"lucene"}')
ORDER BY id
"""
// Test 12: Standalone wildcard '*' matches all non-null values
qt_wildcard_star_all """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ id FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ id FROM ${tableName}
WHERE search('*', '{"default_field":"props.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY id
"""
diff --git a/regression-test/suites/search/test_search_variant_wildcard_custom_analyzer.groovy b/regression-test/suites/search/test_search_variant_wildcard_custom_analyzer.groovy
index 57ba4b5b1eb..b95282b417c 100644
--- a/regression-test/suites/search/test_search_variant_wildcard_custom_analyzer.groovy
+++ b/regression-test/suites/search/test_search_variant_wildcard_custom_analyzer.groovy
@@ -37,7 +37,7 @@ suite("test_search_variant_wildcard_custom_analyzer", "p0") {
def tableName = "test_search_variant_wildcard_custom_analyzer"
sql """ set enable_match_without_inverted_index = false """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ set default_variant_enable_typed_paths_to_sparse = false """
sql """ set default_variant_enable_doc_mode = false """
sql """ set default_variant_max_subcolumns_count = 2048 """
@@ -90,21 +90,21 @@ suite("test_search_variant_wildcard_custom_analyzer", "p0") {
// Test 1: TERM search for 'smith' on lastname - should return John Smith
qt_term_smith """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ objectId FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ objectId FROM ${tableName}
WHERE search('smith', '{"default_field":"overflowProperties.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY objectId
"""
// Test 2: TERM search for 'smithson' on lastname - should return Jane Smithson
qt_term_smithson """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ objectId FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ objectId FROM ${tableName}
WHERE search('smithson', '{"default_field":"overflowProperties.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY objectId
"""
// Test 3: TERM search for 'johnson' on lastname - should return Michael David Johnson
qt_term_johnson """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ objectId FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ objectId FROM ${tableName}
WHERE search('johnson', '{"default_field":"overflowProperties.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY objectId
"""
@@ -113,42 +113,42 @@ suite("test_search_variant_wildcard_custom_analyzer", "p0") {
// Test 4: Leading wildcard '*ith' - should match "smith" (ends with "ith")
qt_wildcard_star_ith """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ objectId FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ objectId FROM ${tableName}
WHERE search('*ith', '{"default_field":"overflowProperties.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY objectId
"""
// Test 5: Middle wildcard 'sm*th' - should match "smith"
qt_wildcard_sm_star_th """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ objectId FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ objectId FROM ${tableName}
WHERE search('sm*th', '{"default_field":"overflowProperties.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY objectId
"""
// Test 6: Single char wildcard 'sm?th' - should match "smith"
qt_wildcard_sm_q_th """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ objectId FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ objectId FROM ${tableName}
WHERE search('sm?th', '{"default_field":"overflowProperties.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY objectId
"""
// Test 7: Trailing wildcard 'smith*' - should match "smith" and "smithson"
qt_wildcard_smith_star """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ objectId FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ objectId FROM ${tableName}
WHERE search('smith*', '{"default_field":"overflowProperties.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY objectId
"""
// Test 8: Trailing wildcard 'sm*' - should match "smith" and "smithson"
qt_wildcard_sm_star """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ objectId FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ objectId FROM ${tableName}
WHERE search('sm*', '{"default_field":"overflowProperties.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY objectId
"""
// Test 9: Leading wildcard '*son' - should match "smithson" and "johnson"
qt_wildcard_star_son """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ objectId FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ objectId FROM ${tableName}
WHERE search('*son', '{"default_field":"overflowProperties.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY objectId
"""
@@ -157,14 +157,14 @@ suite("test_search_variant_wildcard_custom_analyzer", "p0") {
// Test 10: Wildcard 'jo?n' on firstname - should match "john"
qt_wildcard_firstname """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ objectId FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ objectId FROM ${tableName}
WHERE search('jo?n', '{"default_field":"overflowProperties.string_8","default_operator":"and","mode":"lucene"}')
ORDER BY objectId
"""
// Test 11: Wildcard 'mi*' on firstname - should match "michael david"
qt_wildcard_firstname_michael """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ objectId FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ objectId FROM ${tableName}
WHERE search('mi*', '{"default_field":"overflowProperties.string_8","default_operator":"and","mode":"lucene"}')
ORDER BY objectId
"""
@@ -173,7 +173,7 @@ suite("test_search_variant_wildcard_custom_analyzer", "p0") {
// Test 12: Wildcard combined with AND across fields
qt_wildcard_cross_field """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ objectId FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ objectId FROM ${tableName}
WHERE search('overflowProperties.string_17:sm*th AND overflowProperties.string_8:john', '{"default_operator":"and","mode":"lucene"}')
ORDER BY objectId
"""
@@ -182,7 +182,7 @@ suite("test_search_variant_wildcard_custom_analyzer", "p0") {
// Test 13: Standalone wildcard '*' matches all non-null values
qt_wildcard_star_all """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true)*/ objectId FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true)*/ objectId FROM ${tableName}
WHERE search('*', '{"default_field":"overflowProperties.string_17","default_operator":"and","mode":"lucene"}')
ORDER BY objectId
"""
diff --git a/regression-test/suites/search/test_search_vs_match_consistency.groovy b/regression-test/suites/search/test_search_vs_match_consistency.groovy
index 61afe470f32..235d2b61e12 100644
--- a/regression-test/suites/search/test_search_vs_match_consistency.groovy
+++ b/regression-test/suites/search/test_search_vs_match_consistency.groovy
@@ -18,8 +18,8 @@
suite("test_search_vs_match_consistency", "p0") {
def tableName = "search_match_consistency_test"
- // Pin enable_common_expr_pushdown to prevent CI flakiness from fuzzy testing.
- sql """ set enable_common_expr_pushdown = true """
+ // Pin enable_segment_limit_pushdown to prevent CI flakiness from fuzzy testing.
+ sql """ set enable_segment_limit_pushdown = true """
sql "DROP TABLE IF EXISTS ${tableName}"
@@ -106,122 +106,122 @@ suite("test_search_vs_match_consistency", "p0") {
Thread.sleep(5000)
qt_keyword_case_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ title FROM ${keywordTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ title FROM ${keywordTable}
WHERE redirect match_all "Rainbowman"
ORDER BY title
"""
qt_keyword_case_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ title FROM ${keywordTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ title FROM ${keywordTable}
WHERE search('redirect:All("Rainbowman")', '{"mode":"standard"}')
ORDER BY title
"""
// Test Suite 1: Basic OR query consistency
qt_test_1_1_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('title:Ronald OR title:Selma', '{"mode":"standard"}')
"""
qt_test_1_1_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE title match "Ronald" or title match "Selma"
"""
// Test 1.2: OR across different fields
qt_test_1_2_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('title:Ronald OR content:Selma', '{"mode":"standard"}')
"""
qt_test_1_2_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE title match "Ronald" or content match "Selma"
"""
// Test 1.3: Complex OR with ALL operation
qt_test_1_3_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('title:Ronald OR (content:ALL(Selma Blair))', '{"mode":"standard"}')
"""
qt_test_1_3_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE title match "Ronald" or (content match_all "Selma Blair")
"""
// Test Suite 2: NOT query consistency
qt_test_2_1_internal_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('NOT content:Round', '{"mode":"standard"}')
"""
qt_test_2_1_external_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE not search('content:Round', '{"mode":"standard"}')
"""
// Test 2.2: NOT with different fields
qt_test_2_2_internal_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('NOT title:Ronald', '{"mode":"standard"}')
"""
qt_test_2_2_external_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE not search('title:Ronald', '{"mode":"standard"}')
"""
// Test 2.3: NOT with complex expression
qt_test_2_3_internal_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('NOT (title:Ronald AND content:biography)', '{"mode":"standard"}')
"""
qt_test_2_3_external_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE not search('title:Ronald AND content:biography', '{"mode":"standard"}')
"""
// Test Suite 3: NULL value behavior in OR queries
qt_test_3_1_or_with_null """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${tableName}
WHERE search('title:NonExistent OR content:Ronald', '{"mode":"standard"}')
ORDER BY id
"""
qt_test_3_2_or_multiple_null """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${tableName}
WHERE search('title:Mystery OR content:Round', '{"mode":"standard"}')
ORDER BY id
"""
// Test Suite 4: AND query behavior with NULLs
qt_test_4_1_and_with_null """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${tableName}
WHERE search('title:Ronald AND content:biography', '{"mode":"standard"}')
ORDER BY id
"""
// Test Suite 5: Edge cases and complex scenarios
qt_test_5_1_empty_string """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('title:"" OR content:Round', '{"mode":"standard"}')
"""
qt_test_5_2_complex_nested """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('(title:Ronald OR title:Selma) AND NOT (content:Round AND author:NonExistent)', '{"mode":"standard"}')
"""
// Test Suite 6: Performance and consistency verification
qt_test_6_1_large_or_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE search('title:Ronald OR title:Selma OR content:Round OR content:biography OR author:Smith OR tags:history', '{"mode":"standard"}')
"""
qt_test_6_1_large_or_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${tableName}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${tableName}
WHERE title match "Ronald" or title match "Selma" or content match "Round" or content match "biography" or author match "Smith" or tags match "history"
"""
@@ -280,17 +280,17 @@ suite("test_search_vs_match_consistency", "p0") {
// Mandy/Kesha consistency checks
qt_man_pat_1_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${mandyTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${mandyTable}
WHERE search('content:ALL("Mandy Patinkin") OR NOT (content:ANY("Kesha"))', '{"mode":"standard"}')
"""
qt_man_pat_1_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${mandyTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${mandyTable}
WHERE content match_all "Mandy Patinkin" or not (content match_any "Kesha")
"""
qt_man_pat_1_search_rows """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content,
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content,
CASE WHEN title IS NULL THEN 'NULL' ELSE 'NOT_NULL' END AS title_status,
CASE WHEN content IS NULL THEN 'NULL' ELSE 'NOT_NULL' END AS content_status
FROM ${mandyTable}
@@ -299,7 +299,7 @@ suite("test_search_vs_match_consistency", "p0") {
"""
qt_man_pat_1_match_rows """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content,
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content,
CASE WHEN title IS NULL THEN 'NULL' ELSE 'NOT_NULL' END AS title_status,
CASE WHEN content IS NULL THEN 'NULL' ELSE 'NOT_NULL' END AS content_status
FROM ${mandyTable}
@@ -308,54 +308,54 @@ suite("test_search_vs_match_consistency", "p0") {
"""
qt_man_pat_2_search_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${mandyTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${mandyTable}
WHERE search('title:Mandy OR content:Kesha', '{"mode":"standard"}')
"""
qt_man_pat_2_match_or """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${mandyTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${mandyTable}
WHERE title match "Mandy" OR content match "Kesha"
"""
qt_man_pat_2_search_or_ids """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${mandyTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${mandyTable}
WHERE search('title:Mandy OR content:Kesha', '{"mode":"standard"}')
ORDER BY id
"""
qt_man_pat_2_match_or_ids """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id FROM ${mandyTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id FROM ${mandyTable}
WHERE title match "Mandy" OR content match "Kesha"
ORDER BY id
"""
qt_man_pat_3_search_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${mandyTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${mandyTable}
WHERE search('title:Mandy AND category:biography', '{"mode":"standard"}')
"""
qt_man_pat_3_match_and """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${mandyTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${mandyTable}
WHERE title match "Mandy" AND category match "biography"
"""
qt_man_pat_4_search_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${mandyTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${mandyTable}
WHERE search('NOT content:Kesha', '{"mode":"standard"}')
"""
qt_man_pat_4_match_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${mandyTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${mandyTable}
WHERE NOT content match "Kesha"
"""
qt_man_pat_5_search_nested """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${mandyTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${mandyTable}
WHERE search('(title:Mandy OR content:Kesha) AND category:music', '{"mode":"standard"}')
"""
qt_man_pat_5_match_nested """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${mandyTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${mandyTable}
WHERE (title match "Mandy" OR content match "Kesha") AND category match "music"
"""
@@ -405,69 +405,69 @@ suite("test_search_vs_match_consistency", "p0") {
Thread.sleep(10000)
qt_fred_1_search """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${fredTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${fredTable}
WHERE search('title:Fred OR NOT content:ANY("Rahul Gandhi")', '{"mode":"standard"}')
"""
qt_fred_1_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${fredTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${fredTable}
WHERE title match "Fred" OR NOT (content match_any "Rahul Gandhi")
"""
qt_fred_1_search_rows """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${fredTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${fredTable}
WHERE search('title:Fred OR NOT content:ANY("Rahul Gandhi")', '{"mode":"standard"}')
ORDER BY id
"""
qt_fred_1_match_rows """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ id, title, content FROM ${fredTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ id, title, content FROM ${fredTable}
WHERE title match "Fred" OR NOT (content match_any "Rahul Gandhi")
ORDER BY id
"""
qt_fred_2_title_only """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${fredTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${fredTable}
WHERE search('title:Fred', '{"mode":"standard"}')
"""
qt_fred_2_content_any """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${fredTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${fredTable}
WHERE search('content:ANY("Rahul Gandhi")', '{"mode":"standard"}')
"""
qt_fred_2_not_content """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${fredTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${fredTable}
WHERE search('NOT content:ANY("Rahul Gandhi")', '{"mode":"standard"}')
"""
qt_fred_3_or_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${fredTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${fredTable}
WHERE search('title:Fred OR NOT title:Random', '{"mode":"standard"}')
"""
qt_fred_3_or_not_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${fredTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${fredTable}
WHERE title match "Fred" OR NOT title match "Random"
"""
qt_fred_4_and_not """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${fredTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${fredTable}
WHERE search('title:Fred AND NOT content:ANY("Rahul Gandhi")', '{"mode":"standard"}')
"""
qt_fred_4_and_not_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${fredTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${fredTable}
WHERE title match "Fred" AND NOT (content match_any "Rahul Gandhi")
"""
qt_fred_5_nested """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${fredTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${fredTable}
WHERE search('(title:Fred OR title:John) OR NOT (content:ANY("Rahul Gandhi") OR content:ANY("politics"))', '{"mode":"standard"}')
"""
qt_fred_5_nested_match """
- SELECT /*+SET_VAR(enable_common_expr_pushdown=true) */ count(*) FROM ${fredTable}
+ SELECT /*+SET_VAR(enable_segment_limit_pushdown=true) */ count(*) FROM ${fredTable}
WHERE (title match "Fred" OR title match "John") OR NOT (content match_any "Rahul Gandhi" OR content match_any "politics")
"""
diff --git a/regression-test/suites/unique_with_mor_p0/test_read_mor_as_dup_key_topn.groovy b/regression-test/suites/unique_with_mor_p0/test_read_mor_as_dup_key_topn.groovy
new file mode 100644
index 00000000000..10bde8f280a
--- /dev/null
+++ b/regression-test/suites/unique_with_mor_p0/test_read_mor_as_dup_key_topn.groovy
@@ -0,0 +1,54 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// ORDER BY a key prefix with LIMIT on a MOR table listed in read_mor_as_dup_tables.
+// The table is read as DUP, so every version of a key is a row and the TopN sees all of them.
+suite("test_read_mor_as_dup_key_topn") {
+ sql "DROP TABLE IF EXISTS test_read_mor_as_dup_key_topn"
+ sql """
+ CREATE TABLE test_read_mor_as_dup_key_topn (
+ k1 INT NOT NULL,
+ k2 INT NOT NULL,
+ v INT NULL
+ ) ENGINE=OLAP
+ UNIQUE KEY(k1, k2)
+ DISTRIBUTED BY HASH(k1) BUCKETS 1
+ PROPERTIES (
+ "enable_unique_key_merge_on_write" = "false",
+ "disable_auto_compaction" = "true",
+ "replication_num" = "1"
+ )
+ """
+ // Three loads make three overlapping rowsets; key (1, 1) has three versions.
+ sql "INSERT INTO test_read_mor_as_dup_key_topn VALUES (1, 1, 10), (2, 2, 20), (5, 5, 50)"
+ sql "INSERT INTO test_read_mor_as_dup_key_topn VALUES (1, 1, 11), (3, 3, 30), (6, 6, 60)"
+ sql "INSERT INTO test_read_mor_as_dup_key_topn VALUES (1, 1, 12), (4, 4, 40), (7, 7, 70)"
+
+ // Merged read: one row per key.
+ qt_merged "SELECT * FROM test_read_mor_as_dup_key_topn ORDER BY k1, k2 LIMIT 3"
+
+ sql "SET read_mor_as_dup_tables = 'test_read_mor_as_dup_key_topn'"
+ // The crash needs segment LIMIT pushdown, which fuzzy sessions may turn off.
+ sql "SET enable_segment_limit_pushdown = true"
+ order_qt_dup_asc "SELECT * FROM test_read_mor_as_dup_key_topn ORDER BY k1, k2 LIMIT 4"
+ qt_dup_desc "SELECT * FROM test_read_mor_as_dup_key_topn ORDER BY k1 DESC, k2 DESC LIMIT 3"
+ order_qt_dup_prefix "SELECT * FROM test_read_mor_as_dup_key_topn ORDER BY k1 LIMIT 4"
+ order_qt_dup_filter "SELECT * FROM test_read_mor_as_dup_key_topn WHERE v > 10 ORDER BY k1, k2 LIMIT 3"
+ qt_dup_offset "SELECT * FROM test_read_mor_as_dup_key_topn ORDER BY k1, k2 LIMIT 2 OFFSET 3"
+ // A plain LIMIT without ORDER BY still works on the table read as DUP.
+ order_qt_dup_limit "SELECT count(*) FROM (SELECT * FROM test_read_mor_as_dup_key_topn LIMIT 5) t"
+}
diff --git a/regression-test/suites/variant_doc_mode_p2/load.groovy b/regression-test/suites/variant_doc_mode_p2/load.groovy
index 03bd0e3f4cf..893fd7937de 100644
--- a/regression-test/suites/variant_doc_mode_p2/load.groovy
+++ b/regression-test/suites/variant_doc_mode_p2/load.groovy
@@ -132,7 +132,7 @@ suite("test_doc_value_p2", "p2"){
trigger_and_wait_compaction("github_events", "full")
sql """set enable_match_without_inverted_index = false"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
// filter by bloom filter
qt_sql """select cast(v["payload"]["pull_request"]["additions"] as int) from github_events where cast(v["repo"]["name"] as string) = 'xpressengine/xe-core' order by 1;"""
diff --git a/regression-test/suites/variant_github_events_new_p2/load.groovy b/regression-test/suites/variant_github_events_new_p2/load.groovy
index 5fd5a120d8f..4d439cc92ec 100644
--- a/regression-test/suites/variant_github_events_new_p2/load.groovy
+++ b/regression-test/suites/variant_github_events_new_p2/load.groovy
@@ -90,11 +90,11 @@ suite("regression_test_variant_github_events_p2", "p2"){
// test array index
sql """insert into github_events_arr select k, cast(v['payload']['pull_request']['head']['repo']['topics'] as array<text>) from github_events"""
- sql "set enable_common_expr_pushdown = true; "
+ sql "set enable_segment_limit_pushdown = true; "
qt_sql """select count() from github_events_arr where array_contains(v, 'css');"""
- sql "set enable_common_expr_pushdown = false; "
+ sql "set enable_segment_limit_pushdown = false; "
qt_sql """select count() from github_events_arr where array_contains(v, 'css');"""
- sql "set enable_common_expr_pushdown = true; "
+ sql "set enable_segment_limit_pushdown = true; "
// TODO fix compaction issue, this case could be stable
qt_sql """select cast(v["payload"]["pull_request"]["additions"] as int) from github_events where cast(v["repo"]["name"] as string) = 'xpressengine/xe-core' order by 1;"""
@@ -152,8 +152,7 @@ suite("regression_test_variant_github_events_p2", "p2"){
// query and filterd by inverted index
if (!enable_typed_paths_to_sparse) {
profile("test_profile_1") {
- sql """ set enable_common_expr_pushdown = true; """
- sql """ set enable_common_expr_pushdown_for_inverted_index = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
sql """ set enable_pipeline_x_engine = true;"""
sql """ set enable_profile = true;"""
sql """ set profile_level = 2;"""
@@ -177,7 +176,6 @@ suite("regression_test_variant_github_events_p2", "p2"){
}
}
- sql """ set enable_common_expr_pushdown = true; """
- sql """ set enable_common_expr_pushdown_for_inverted_index = true; """
+ sql """ set enable_segment_limit_pushdown = true; """
qt_sql_inv """select count() from github_events where arrays_overlap(cast(v['payload']['pull_request']['head']['repo']['topics'] as array<text>), ['javascript', 'css'] )"""
}
diff --git a/regression-test/suites/variant_github_events_nonConcurrent_p2/load.groovy b/regression-test/suites/variant_github_events_nonConcurrent_p2/load.groovy
index 0bf08c0633c..41f7da4f194 100644
--- a/regression-test/suites/variant_github_events_nonConcurrent_p2/load.groovy
+++ b/regression-test/suites/variant_github_events_nonConcurrent_p2/load.groovy
@@ -125,7 +125,7 @@ suite("regression_test_variant_github_events_p2", "nonConcurrent,p2"){
trigger_and_wait_compaction("github_events", "full", 1800)
sql """set enable_match_without_inverted_index = false"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
// filter by bloom filter
qt_sql """select cast(v["payload"]["pull_request"]["additions"] as int) from github_events where cast(v["repo"]["name"] as string) = 'xpressengine/xe-core' order by 1;"""
diff --git a/regression-test/suites/variant_p0/doc_mode/load.groovy b/regression-test/suites/variant_p0/doc_mode/load.groovy
index bfa7a95fdf8..c9d1dc0f7e7 100644
--- a/regression-test/suites/variant_p0/doc_mode/load.groovy
+++ b/regression-test/suites/variant_p0/doc_mode/load.groovy
@@ -302,7 +302,7 @@ suite("regression_test_variant_doc_value", "p0"){
sql """insert into ${table_name} values (5, ${variantV2Function}('{"i" : 1}')), (1, ${variantV2Function}('{"a" : 1}'))"""
sql """insert into ${table_name} values (6, ${variantV2Function}('{"j" : 1}')), (1, ${variantV2Function}('{"a" : 1}'))"""
sql """insert into ${table_name} values (6, ${variantV2Function}('{"k" : 1}')), (1, ${variantV2Function}('{"a" : 1}'))"""
- sql "select /*+SET_VAR(batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=false,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=4,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=true,parallel_scan_max_scanners_count=16,parallel_scan_min_rows_per_scanner=128,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_filter_type=2,enable_parallel_result_sink=false,sort_phase_num=0,enable_nereids_ [...]
+ sql "select /*+SET_VAR(batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=false,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=4,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=true,parallel_scan_max_scanners_count=16,parallel_scan_min_rows_per_scanner=128,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_filter_type=2,enable_parallel_result_sink=false,sort_phase_num=0,enable_nereids_ [...]
qt_sql_36_1 "select cast(v['a'] as int), cast(v['b'] as int), cast(v['c'] as int) from ${table_name} order by k limit 10"
sql "DELETE FROM ${table_name} WHERE k=1"
sql "select * from ${table_name}"
diff --git a/regression-test/suites/variant_p0/doc_mode/predefine/test_prdefine_insert_into_select.groovy b/regression-test/suites/variant_p0/doc_mode/predefine/test_prdefine_insert_into_select.groovy
index 9bbe81760b2..3161cfd310e 100644
--- a/regression-test/suites/variant_p0/doc_mode/predefine/test_prdefine_insert_into_select.groovy
+++ b/regression-test/suites/variant_p0/doc_mode/predefine/test_prdefine_insert_into_select.groovy
@@ -86,6 +86,6 @@ suite("predefine_insert_into_select_doc_mode", "p0"){
} else {
sql """ set enable_match_without_inverted_index = true """
}
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
order_qt_sql """ select count() from toTable where cast (var['d'] as string) match '123' """
}
diff --git a/regression-test/suites/variant_p0/doc_mode/predefine/test_predefine_pattern.groovy b/regression-test/suites/variant_p0/doc_mode/predefine/test_predefine_pattern.groovy
index 682883f5e7c..d57dcacaeb0 100644
--- a/regression-test/suites/variant_p0/doc_mode/predefine/test_predefine_pattern.groovy
+++ b/regression-test/suites/variant_p0/doc_mode/predefine/test_predefine_pattern.groovy
@@ -19,7 +19,7 @@ suite("variant_predefine_base_doc_value", "p0"){
def variantV2Function = getFeConfig("enable_variant_v2").toBoolean() ? "parse_to_variant" : ""
sql """ set describe_extend_variant_column = true """
sql """ set enable_match_without_inverted_index = false """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ set default_variant_enable_typed_paths_to_sparse = false """
sql """ set default_variant_enable_doc_mode = false """
def count = new Random().nextInt(5)
diff --git a/regression-test/suites/variant_p0/doc_mode/predefine/test_predefine_schema_change.groovy b/regression-test/suites/variant_p0/doc_mode/predefine/test_predefine_schema_change.groovy
index 02972d1fa55..643059d6cc8 100644
--- a/regression-test/suites/variant_p0/doc_mode/predefine/test_predefine_schema_change.groovy
+++ b/regression-test/suites/variant_p0/doc_mode/predefine/test_predefine_schema_change.groovy
@@ -50,7 +50,7 @@ suite("predefine_schema_change_doc_value", "p0"){
sql """ set enable_match_without_inverted_index = true """
}
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql """ select count() from ${tableName} where cast (var['d'] as string) match '123' """
qt_sql """ select * from ${tableName} """
// V1 reports a subpath-to-type map for the root, while V2 reports the root type as object.
diff --git a/regression-test/suites/variant_p0/doc_mode/predefine/test_predefine_type_index.groovy b/regression-test/suites/variant_p0/doc_mode/predefine/test_predefine_type_index.groovy
index d2afa7dc98d..8d83b1cb7af 100644
--- a/regression-test/suites/variant_p0/doc_mode/predefine/test_predefine_type_index.groovy
+++ b/regression-test/suites/variant_p0/doc_mode/predefine/test_predefine_type_index.groovy
@@ -20,7 +20,7 @@ suite("variant_predefine_index_doc_value", "p0"){
def variantV2Function = enableVariantV2 ? "parse_to_variant" : ""
sql """ set describe_extend_variant_column = true """
sql """ set enable_match_without_inverted_index = false """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ set default_variant_enable_typed_paths_to_sparse = false """
sql """ set default_variant_enable_doc_mode = true """
sql """ set default_variant_doc_materialization_min_rows = 0 """
@@ -53,7 +53,7 @@ suite("variant_predefine_index_doc_value", "p0"){
qt_sql """select * from ${tableName} order by id"""
sql """ set profile_level = 2"""
sql """ set inverted_index_skip_threshold = 0 """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ set enable_match_without_inverted_index = false """
qt_sql """ select count() from ${tableName} where cast(var['path']['int'] as int) = 789 """
qt_sql """ select count() from ${tableName} where cast(var['path']['decimal'] as DECIMAL(15, 12)) = 789.789123456789 """
diff --git a/regression-test/suites/variant_p0/doc_mode/with_index/test_array_contains_with_inverted_index.groovy b/regression-test/suites/variant_p0/doc_mode/with_index/test_array_contains_with_inverted_index.groovy
index 03208c22a04..5f828f76d95 100644
--- a/regression-test/suites/variant_p0/doc_mode/with_index/test_array_contains_with_inverted_index.groovy
+++ b/regression-test/suites/variant_p0/doc_mode/with_index/test_array_contains_with_inverted_index.groovy
@@ -22,9 +22,8 @@ suite("array_contains_with_index_doc_value", "p0") {
def resultColumns = "apply_date, id, sort_json_object_keys(cast(inventors as json))"
setFeConfigTemporary([enable_inverted_index_v1_for_variant: true]) {
- // If we use common expr pass to inverted index , we should set enable_common_expr_pushdown = true
- sql """ set enable_common_expr_pushdown = true; """
- sql """ set enable_common_expr_pushdown_for_inverted_index = true; """
+ // Pin enable_segment_limit_pushdown to keep inverted-index pushdown stable under fuzzy testing
+ sql """ set enable_segment_limit_pushdown = true; """
sql """ set enable_profile = true;"""
sql "DROP TABLE IF EXISTS ${indexTblName}"
@@ -65,7 +64,7 @@ suite("array_contains_with_index_doc_value", "p0") {
sql """ INSERT INTO `${indexTblName}`(`apply_date`, `id`, `inventors`) VALUES ('2019-01-01', '0974e7a82e30d1af83205e474fadd0a2', ${variantV2Function}('{"inventors":["w"]}')); """
sql """ INSERT INTO `${indexTblName}`(`apply_date`, `id`, `inventors`) VALUES ('2019-01-01', '26823b3995ee38bd145ddd910b2f6300', ${variantV2Function}('{"inventors":["x"]}')); """
sql """ INSERT INTO `${indexTblName}`(`apply_date`, `id`, `inventors`) VALUES ('2019-01-01', 'ee27ee1da291e46403c408e220bed6e1', ${variantV2Function}('{"inventors":["y"]}')); """
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
qt_sql """ select count() from ${indexTblName}"""
def param_contains = ["'s'", "''", null]
@@ -89,24 +88,24 @@ suite("array_contains_with_index_doc_value", "p0") {
for (int i = 0 ; i < param.size(); ++i) {
def p = param[i]
log.info("param: ${p}")
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2019-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2019-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) or apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) or apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2019-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2019-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) or apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) or apply_date = '2017-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ ${resultColumns} from tai where (arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2017-01-01') or apply_date = '2019-01-01' order by id; """
- order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ ${resultColumns} from tai where (arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2017-01-01') or apply_date = '2019-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2019-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2019-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) or apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ ${resultColumns} from tai where arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) or apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2019-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2019-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) or apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ ${resultColumns} from tai where !arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) or apply_date = '2017-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = true)*/ ${resultColumns} from tai where (arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2017-01-01') or apply_date = '2019-01-01' order by id; """
+ order_qt_sql """ select /*+SET_VAR(enable_segment_limit_pushdown = false)*/ ${resultColumns} from tai where (arrays_overlap(cast(inventors['inventors'] as array<text>), ${p}) and apply_date = '2017-01-01') or apply_date = '2019-01-01' order by id; """
}
}
}
diff --git a/regression-test/suites/variant_p0/ext_meta/test_variant_external_meta_integration.groovy b/regression-test/suites/variant_p0/ext_meta/test_variant_external_meta_integration.groovy
index b36c1303b02..fb8e806f6a2 100644
--- a/regression-test/suites/variant_p0/ext_meta/test_variant_external_meta_integration.groovy
+++ b/regression-test/suites/variant_p0/ext_meta/test_variant_external_meta_integration.groovy
@@ -31,8 +31,7 @@ suite("test_variant_external_meta_integration", "nonConcurrent") {
}
sql "set enable_match_without_inverted_index = false"
- sql "set enable_common_expr_pushdown_for_inverted_index = true"
- sql "set enable_common_expr_pushdown = true"
+ sql "set enable_segment_limit_pushdown = true"
// Test 1: External meta with inverted index on extracted columns
sql "DROP TABLE IF EXISTS test_inverted_index_extracted"
diff --git a/regression-test/suites/variant_p0/load.groovy b/regression-test/suites/variant_p0/load.groovy
index d1dac8005cd..0956c5c5740 100644
--- a/regression-test/suites/variant_p0/load.groovy
+++ b/regression-test/suites/variant_p0/load.groovy
@@ -299,7 +299,7 @@ suite("regression_test_variant", "p0"){
sql """insert into ${table_name} values (5, ${variantV2Function}('{"i" : 1}')), (1, ${variantV2Function}('{"a" : 1}'))"""
sql """insert into ${table_name} values (6, ${variantV2Function}('{"j" : 1}')), (1, ${variantV2Function}('{"a" : 1}'))"""
sql """insert into ${table_name} values (6, ${variantV2Function}('{"k" : 1}')), (1, ${variantV2Function}('{"a" : 1}'))"""
- sql "select /*+SET_VAR(batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=false,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=4,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=true,parallel_scan_max_scanners_count=16,parallel_scan_min_rows_per_scanner=128,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_filter_type=2,enable_parallel_result_sink=false,sort_phase_num=0,enable_nereids_ [...]
+ sql "select /*+SET_VAR(batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=false,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=4,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=true,parallel_scan_max_scanners_count=16,parallel_scan_min_rows_per_scanner=128,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_filter_type=2,enable_parallel_result_sink=false,sort_phase_num=0,enable_nereids_ [...]
qt_sql_36_1 "select cast(v['a'] as int), cast(v['b'] as int), cast(v['c'] as int) from ${table_name} order by k limit 10"
sql "DELETE FROM ${table_name} WHERE k=1"
sql "select * from ${table_name}"
diff --git a/regression-test/suites/variant_p0/predefine/predefined_typed_to_sparse.groovy b/regression-test/suites/variant_p0/predefine/predefined_typed_to_sparse.groovy
index c4d8c4e7fa7..e12fd4b8113 100644
--- a/regression-test/suites/variant_p0/predefine/predefined_typed_to_sparse.groovy
+++ b/regression-test/suites/variant_p0/predefine/predefined_typed_to_sparse.groovy
@@ -39,7 +39,7 @@ suite("predefined_typed_to_sparse", "p0,nonConcurrent") {
cast(var['datev2_1'] as datev2), cast(var['ipv4_1'] as ipv4),
cast(var['ipv6_1'] as ipv6), cast(var['largeint_1'] as largeint),
cast(var['char_1'] as text)"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ set default_variant_enable_doc_mode = false """
def count = new Random().nextInt(10) + 1
diff --git a/regression-test/suites/variant_p0/predefine/predefined_typed_to_sparse_1shard.groovy b/regression-test/suites/variant_p0/predefine/predefined_typed_to_sparse_1shard.groovy
index 8e7023ccfaf..e74cf31dee0 100644
--- a/regression-test/suites/variant_p0/predefine/predefined_typed_to_sparse_1shard.groovy
+++ b/regression-test/suites/variant_p0/predefine/predefined_typed_to_sparse_1shard.groovy
@@ -39,7 +39,7 @@ suite("test_predefine_typed_to_sparse_1shard", "p0,nonConcurrent") {
cast(var['datev2_1'] as datev2), cast(var['ipv4_1'] as ipv4),
cast(var['ipv6_1'] as ipv6), cast(var['largeint_1'] as largeint),
cast(var['char_1'] as text)"""
- sql """ set enable_common_expr_pushdown = true """
+ sql """ set enable_segment_limit_pushdown = true """
sql """ set default_variant_enable_doc_mode = false """
def load_json_data = {table_name, file_name ->
diff --git a/regression-test/suites/variant_p0/predefine/test_custom_analyzer.groovy b/regression-test/suites/variant_p0/predefine/test_custom_analyzer.groovy
index 8a670ca0738..4f08a140aa1 100644
--- a/regression-test/suites/variant_p0/predefine/test_custom_analyzer.groovy
+++ b/regression-test/suites/variant_p0/predefine/test_custom_analyzer.groovy
@@ -111,7 +111,7 @@ suite("test_variant_custom_analyzer", "p0") {
try {
trigger_and_wait_compaction(indexTbName1, "full", 1800)
sql "sync"
... 624 lines suppressed ...
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org