This is an automated email from the ASF dual-hosted git repository.
airborne pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new afb477c66df [Fix](inverted index) Fix wrong need read data opt when
enable_common_expr_pushdown is disabled #40689 (#41562)
afb477c66df is described below
commit afb477c66df216f7020ebb659fe436f9e3fabaad
Author: airborne12 <[email protected]>
AuthorDate: Tue Oct 8 22:12:10 2024 +0800
[Fix](inverted index) Fix wrong need read data opt when
enable_common_expr_pushdown is disabled #40689 (#41562)
cherry pick from #40689
---
be/src/olap/rowset/segment_v2/segment_iterator.cpp | 6 ++++++
regression-test/data/inverted_index_p0/test_need_read_data.out | 1 -
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.cpp
b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
index bce19bad659..a9b5e792b2a 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
@@ -972,6 +972,12 @@ 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_inverted_index_status.find(cid);
if (pred_it != _column_predicate_inverted_index_status.end()) {
const auto& pred_map = pred_it->second;
diff --git a/regression-test/data/inverted_index_p0/test_need_read_data.out
b/regression-test/data/inverted_index_p0/test_need_read_data.out
index 5999e7640ad..186138a45ad 100644
--- a/regression-test/data/inverted_index_p0/test_need_read_data.out
+++ b/regression-test/data/inverted_index_p0/test_need_read_data.out
@@ -33,4 +33,3 @@
-- !sql_11 --
1
-
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]