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/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new cfab124ddd [Chore](inverted index) change Status::EndOfFile to just 
logging info, remove useless print (#19721)
cfab124ddd is described below

commit cfab124ddd65cd15a966ad342109442879f28d46
Author: airborne12 <[email protected]>
AuthorDate: Thu May 18 08:44:18 2023 +0800

    [Chore](inverted index) change Status::EndOfFile to just logging info, 
remove useless print (#19721)
---
 .../rowset/segment_v2/inverted_index_reader.cpp    | 28 +++++++++++++++-------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp 
b/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp
index 3b3bef6d7a..5975c10a71 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp
+++ b/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp
@@ -478,12 +478,7 @@ Status BkdIndexReader::bkd_query(OlapReaderStatistics* 
stats, const std::string&
                                  const void* query_value, 
InvertedIndexQueryType query_type,
                                  
std::shared_ptr<lucene::util::bkd::bkd_reader>& r,
                                  InvertedIndexVisitor* visitor) {
-    auto status = get_bkd_reader(r);
-    if (!status.ok()) {
-        LOG(WARNING) << "get bkd reader for column " << column_name
-                     << " failed: " << status.code_as_string();
-        return status;
-    }
+    RETURN_IF_ERROR(get_bkd_reader(r));
     char tmp[r->bytes_per_dim_];
     switch (query_type) {
     case InvertedIndexQueryType::EQUAL_QUERY: {
@@ -520,7 +515,15 @@ Status BkdIndexReader::try_query(OlapReaderStatistics* 
stats, const std::string&
     auto visitor = std::make_unique<InvertedIndexVisitor>(nullptr, query_type, 
true);
     std::shared_ptr<lucene::util::bkd::bkd_reader> r;
     try {
-        RETURN_IF_ERROR(bkd_query(stats, column_name, query_value, query_type, 
r, visitor.get()));
+        auto st = bkd_query(stats, column_name, query_value, query_type, r, 
visitor.get());
+        if (!st.ok()) {
+            if (st.code() == ErrorCode::END_OF_FILE) {
+                return Status::OK();
+            }
+            LOG(WARNING) << "bkd_query for column " << column_name
+                         << " failed: " << st.code_as_string();
+            return st;
+        }
         *count = r->estimate_point_count(visitor.get());
     } catch (const CLuceneError& e) {
         LOG(WARNING) << "BKD Query CLuceneError Occurred, error msg: " << 
e.what();
@@ -562,7 +565,15 @@ Status BkdIndexReader::query(OlapReaderStatistics* stats, 
const std::string& col
     std::shared_ptr<lucene::util::bkd::bkd_reader> r;
     try {
         SCOPED_RAW_TIMER(&stats->inverted_index_searcher_search_timer);
-        RETURN_IF_ERROR(bkd_query(stats, column_name, query_value, query_type, 
r, visitor.get()));
+        auto st = bkd_query(stats, column_name, query_value, query_type, r, 
visitor.get());
+        if (!st.ok()) {
+            if (st.code() == ErrorCode::END_OF_FILE) {
+                return Status::OK();
+            }
+            LOG(WARNING) << "bkd_query for column " << column_name
+                         << " failed: " << st.code_as_string();
+            return st;
+        }
         r->intersect(visitor.get());
     } catch (const CLuceneError& e) {
         LOG(WARNING) << "BKD Query CLuceneError Occurred, error msg: " << 
e.what();
@@ -606,6 +617,7 @@ Status 
BkdIndexReader::get_bkd_reader(std::shared_ptr<lucene::util::bkd::bkd_rea
 
     bkdReader = 
std::make_shared<lucene::util::bkd::bkd_reader>(data_in.release());
     if (0 == bkdReader->read_meta(meta_in.get())) {
+        VLOG_NOTICE << "bkd index file is empty:" << 
_compoundReader->toString();
         return Status::EndOfFile("bkd index file is empty");
     }
 


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

Reply via email to