You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/12/14 04:29:26 UTC

[doris] 05/13: [fix](statistics) fix missing scanBytes and scanRows in query statist… (#14750)

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

morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git

commit e17391305f34109241c2cb2d33fa6c0988c99d91
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 ad978de41f..64e4c9102a 100644
--- a/be/src/vec/exec/scan/new_olap_scan_node.cpp
+++ b/be/src/vec/exec/scan/new_olap_scan_node.cpp
@@ -35,6 +35,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());
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 dc882aa6a9..6338c4aee6 100644
--- a/be/src/vec/exec/scan/new_olap_scan_node.h
+++ b/be/src/vec/exec/scan/new_olap_scan_node.h
@@ -28,6 +28,7 @@ public:
     friend class NewOlapScanner;
 
     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