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/12/05 01:17:56 UTC

[doris] branch master updated: [fix](statistics) fix missing scanBytes and scanRows in query statist… (#14750)

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 e141664339 [fix](statistics) fix missing scanBytes and scanRows in query statist… (#14750)
e141664339 is described below

commit e141664339e7b40a6259b055ee70e65d1fd11a07
Author: wxy <du...@gmail.com>
AuthorDate: Mon Dec 5 09:17:51 2022 +0800

    [fix](statistics) fix missing scanBytes and scanRows in query statist… (#14750)
    
    * [fix](statistics) fix missing scanBytes and scanRows in query statistics when enable_vectorized_engine=true.
    
    Co-authored-by: wangxiangyu@360shuke.com <wa...@360shuke.com>
---
 be/src/vec/exec/scan/new_olap_scan_node.cpp | 7 +++++++
 be/src/vec/exec/scan/new_olap_scan_node.h   | 1 +
 2 files changed, 8 insertions(+)

diff --git a/be/src/vec/exec/scan/new_olap_scan_node.cpp b/be/src/vec/exec/scan/new_olap_scan_node.cpp
index c72f5b289d..007cd3c65a 100644
--- a/be/src/vec/exec/scan/new_olap_scan_node.cpp
+++ b/be/src/vec/exec/scan/new_olap_scan_node.cpp
@@ -38,6 +38,13 @@ NewOlapScanNode::NewOlapScanNode(ObjectPool* pool, const TPlanNode& tnode,
     }
 }
 
+Status NewOlapScanNode::collect_query_statistics(QueryStatistics* statistics) {
+    RETURN_IF_ERROR(ExecNode::collect_query_statistics(statistics));
+    statistics->add_scan_bytes(_read_compressed_counter->value());
+    statistics->add_scan_rows(_raw_rows_counter->value());
+    return Status::OK();
+}
+
 Status NewOlapScanNode::prepare(RuntimeState* state) {
     RETURN_IF_ERROR(VScanNode::prepare(state));
     SCOPED_CONSUME_MEM_TRACKER(mem_tracker_growh());
diff --git a/be/src/vec/exec/scan/new_olap_scan_node.h b/be/src/vec/exec/scan/new_olap_scan_node.h
index e72ed82a4a..474321f8ac 100644
--- a/be/src/vec/exec/scan/new_olap_scan_node.h
+++ b/be/src/vec/exec/scan/new_olap_scan_node.h
@@ -33,6 +33,7 @@ public:
     friend class doris::pipeline::OlapScanOperator;
 
     Status prepare(RuntimeState* state) override;
+    Status collect_query_statistics(QueryStatistics* statistics) override;
 
     void set_scan_ranges(const std::vector<TScanRangeParams>& scan_ranges) override;
 


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