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 7357d7bd3bc [Update](inverted index) Add column name to debug point 
for "no need to read data" optimization #37649 (#38579)
7357d7bd3bc is described below

commit 7357d7bd3bc6b56d980d3707ddcee88c9ae692f7
Author: airborne12 <[email protected]>
AuthorDate: Wed Jul 31 19:17:46 2024 +0800

    [Update](inverted index) Add column name to debug point for "no need to 
read data" optimization #37649 (#38579)
    
    cherry pick from #37649
---
 be/src/olap/rowset/segment_v2/segment_iterator.cpp |  10 +-
 .../test_need_read_data_fault_injection.out        | 249 +++++++++++++++++++++
 .../test_need_read_data_fault_injection.groovy     |  12 +
 3 files changed, 270 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 21998060716..4c29c7d12ba 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
@@ -1967,7 +1967,15 @@ Status SegmentIterator::_read_columns_by_index(uint32_t 
nrows_read_limit, uint32
         }
 
         DBUG_EXECUTE_IF("segment_iterator._read_columns_by_index", {
-            return Status::Error<ErrorCode::INTERNAL_ERROR>("{} does not need 
to read data");
+            auto debug_col_name = 
DebugPoints::instance()->get_debug_param_or_default<std::string>(
+                    "segment_iterator._read_columns_by_index", "column_name", 
"");
+            if (debug_col_name.empty()) {
+                return Status::Error<ErrorCode::INTERNAL_ERROR>("{} does not 
need to read data");
+            }
+            auto col_name = _opts.tablet_schema->column(cid).name();
+            if (debug_col_name.find(col_name) != std::string::npos) {
+                return Status::Error<ErrorCode::INTERNAL_ERROR>("{} does not 
need to read data");
+            }
         })
 
         if (is_continuous) {
diff --git 
a/regression-test/data/fault_injection_p0/test_need_read_data_fault_injection.out
 
b/regression-test/data/fault_injection_p0/test_need_read_data_fault_injection.out
index 37885e404d3..6de2c921eb2 100644
--- 
a/regression-test/data/fault_injection_p0/test_need_read_data_fault_injection.out
+++ 
b/regression-test/data/fault_injection_p0/test_need_read_data_fault_injection.out
@@ -20,3 +20,252 @@
 -- !sql --
 18
 
+-- !sql --
+GET /images/hm_f98_top.gif HTTP/1.1
+GET /french/images/news_btn_press_off.gif HTTP/1.1
+GET /french/images/fpnewstop.gif HTTP/1.1
+GET /french/images/space.gif HTTP/1.1
+GET /images/case5.gif HTTP/1.1
+GET /french/images/top_stories.gif HTTP/1.1
+GET /french/images/today_new.gif HTTP/1.1
+GET /images/bord_stories01.gif HTTP/1.1
+GET /images/dburton.jpg HTTP/1.1
+GET /images/bord_stories.gif HTTP/1.1
+GET /french/images/lateb_new.gif HTTP/1.1
+GET /images/ligneb01.gif HTTP/1.1
+GET /images/ligne4_latebreak.gif HTTP/1.1
+GET /images/ligne.gif HTTP/1.1
+GET /french/images/news_btn_kits_off.gif HTTP/1.1
+GET /images/ligneb.gif HTTP/1.1
+GET /french/images/archives.gif HTTP/1.1
+GET /french/news/3004arge.htm HTTP/1.1
+
+-- !sql --
+200
+200
+200
+304
+200
+304
+304
+200
+200
+304
+304
+200
+200
+304
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+304
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+304
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+304
+304
+304
+206
+200
+304
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+304
+200
+200
+200
+304
+200
+200
+200
+200
+200
+200
+200
+200
+200
+304
+200
+200
+200
+200
+200
+200
+200
+304
+200
+200
+200
+200
+200
+200
+304
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+304
+200
+200
+200
+200
+200
+200
+304
+200
+200
+200
+200
+304
+200
+304
+200
+304
+200
+304
+206
+200
+200
+200
+200
+200
+200
+200
+200
+200
+200
+304
+200
+304
+304
+200
+200
+200
+200
+200
+304
+200
+200
+
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 d7a92f8e7e9..22e9e5eda3f 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
@@ -89,6 +89,18 @@ suite("test_need_read_data_fault_injection", 
"nonConcurrent") {
       } finally {
         
GetDebugPoint().disableDebugPointForAllBEs("segment_iterator._read_columns_by_index")
       }
+      try {
+        
GetDebugPoint().enableDebugPointForAllBEs("segment_iterator._read_columns_by_index",
 [column_name: "clientip"])
+        qt_sql """ select request from ${indexTbName} where (clientip match 
'images' or clientip match '5' or clientip match 'english'); """
+      } finally {
+        
GetDebugPoint().disableDebugPointForAllBEs("segment_iterator._read_columns_by_index")
+      }
+      try {
+        
GetDebugPoint().enableDebugPointForAllBEs("segment_iterator._read_columns_by_index",
 [column_name: "clientip,request"])
+        qt_sql """ select status from ${indexTbName} where (clientip match 
'images' or clientip match '5' or request match_phrase 'hm'); """
+      } finally {
+        
GetDebugPoint().disableDebugPointForAllBEs("segment_iterator._read_columns_by_index")
+      }
     } finally {
     }
 }
\ No newline at end of file


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

Reply via email to