This is an automated email from the ASF dual-hosted git repository.
kxiao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new c51146df109 [Fix](segment) need to rebuild col_id_to_predicates when
true predicates encountered (#25685)
c51146df109 is described below
commit c51146df109a7079a4ee65585eb53fa593843c8e
Author: airborne12 <[email protected]>
AuthorDate: Mon Oct 23 10:26:52 2023 +0800
[Fix](segment) need to rebuild col_id_to_predicates when true predicates
encountered (#25685)
---
be/src/olap/rowset/segment_v2/segment.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/be/src/olap/rowset/segment_v2/segment.cpp
b/be/src/olap/rowset/segment_v2/segment.cpp
index 06cc32d7e27..bf41f3a12e9 100644
--- a/be/src/olap/rowset/segment_v2/segment.cpp
+++ b/be/src/olap/rowset/segment_v2/segment.cpp
@@ -172,6 +172,18 @@ Status Segment::new_iterator(SchemaSPtr schema, const
StorageReadOptions& read_o
if (pruned) {
auto options_with_pruned_predicates = read_options;
options_with_pruned_predicates.column_predicates =
pruned_predicates;
+ //because column_predicates is changed, we need to rebuild
col_id_to_predicates so that inverted index will not go through it.
+ options_with_pruned_predicates.col_id_to_predicates.clear();
+ for (auto* pred :
options_with_pruned_predicates.column_predicates) {
+ if
(!options_with_pruned_predicates.col_id_to_predicates.contains(
+ pred->column_id())) {
+ options_with_pruned_predicates.col_id_to_predicates.insert(
+ {pred->column_id(),
std::make_shared<AndBlockColumnPredicate>()});
+ }
+ auto* single_column_block_predicate = new
SingleColumnBlockPredicate(pred);
+
options_with_pruned_predicates.col_id_to_predicates[pred->column_id()]
+ ->add_column_predicate(single_column_block_predicate);
+ }
LOG(INFO) << "column_predicates pruned from " <<
read_options.column_predicates.size()
<< " to " << pruned_predicates.size();
return iter->get()->init(options_with_pruned_predicates);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]