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 2022/06/14 07:35:37 UTC

[incubator-doris] branch master updated: [Bug] Fix bug push value predicate of unique table when have sequence column (#10060)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 14bc971159 [Bug] Fix bug push value predicate of unique table when have sequence column (#10060)
14bc971159 is described below

commit 14bc971159001e265d9902f8835a7f6c52df9c5e
Author: HappenLee <ha...@hotmail.com>
AuthorDate: Tue Jun 14 15:35:31 2022 +0800

    [Bug] Fix bug push value predicate of unique table when have sequence column (#10060)
    
    Co-authored-by: lihaopeng <li...@baidu.com>
---
 be/src/olap/rowset/beta_rowset_reader.cpp | 14 ++++++++++----
 be/src/olap/rowset/beta_rowset_reader.h   |  2 ++
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/be/src/olap/rowset/beta_rowset_reader.cpp b/be/src/olap/rowset/beta_rowset_reader.cpp
index a532823cee..ba5795c3c0 100644
--- a/be/src/olap/rowset/beta_rowset_reader.cpp
+++ b/be/src/olap/rowset/beta_rowset_reader.cpp
@@ -71,10 +71,8 @@ Status BetaRowsetReader::init(RowsetReaderContext* read_context) {
                                               read_context->predicates->begin(),
                                               read_context->predicates->end());
     }
-    // if unique table with rowset [0-x] or [0-1] [2-y] [...],
-    // value column predicates can be pushdown on rowset [0-x] or [2-y]
-    if (_rowset->keys_type() == UNIQUE_KEYS &&
-        (_rowset->start_version() == 0 || _rowset->start_version() == 2)) {
+
+    if (_should_push_down_value_predicates()) {
         if (read_context->value_predicates != nullptr) {
             read_options.column_predicates.insert(read_options.column_predicates.end(),
                                                   read_context->value_predicates->begin(),
@@ -237,4 +235,12 @@ Status BetaRowsetReader::next_block(vectorized::Block* block) {
     return Status::OK();
 }
 
+bool BetaRowsetReader::_should_push_down_value_predicates() const {
+    // if unique table with rowset [0-x] or [0-1] [2-y] [...],
+    // value column predicates can be pushdown on rowset [0-x] or [2-y], [2-y] must be compaction and not overlapping
+    return _rowset->keys_type() == UNIQUE_KEYS &&
+           (_rowset->start_version() == 0 || _rowset->start_version() == 2) &&
+           !_rowset->_rowset_meta->is_segments_overlapping();
+}
+
 } // namespace doris
diff --git a/be/src/olap/rowset/beta_rowset_reader.h b/be/src/olap/rowset/beta_rowset_reader.h
index 885d16b8c7..564980bac8 100644
--- a/be/src/olap/rowset/beta_rowset_reader.h
+++ b/be/src/olap/rowset/beta_rowset_reader.h
@@ -53,6 +53,8 @@ public:
     RowsetTypePB type() const override { return RowsetTypePB::BETA_ROWSET; }
 
 private:
+    bool _should_push_down_value_predicates() const;
+
     std::unique_ptr<Schema> _schema;
     RowsetReaderContext* _context;
     BetaRowsetSharedPtr _rowset;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org