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

gabriellee 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 947b116318a [pipelineX](fix) Fix BE crash due to ES scan operator 
(#24983)
947b116318a is described below

commit 947b116318aa7beacca733e66bae9e018a33df83
Author: Gabriel <[email protected]>
AuthorDate: Wed Sep 27 20:45:38 2023 +0800

    [pipelineX](fix) Fix BE crash due to ES scan operator (#24983)
---
 be/src/pipeline/exec/es_scan_operator.h |  4 ++--
 be/src/vec/exec/scan/new_es_scanner.cpp | 16 ++++++++++++----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/be/src/pipeline/exec/es_scan_operator.h 
b/be/src/pipeline/exec/es_scan_operator.h
index 96f53c02cdc..9802357a5a6 100644
--- a/be/src/pipeline/exec/es_scan_operator.h
+++ b/be/src/pipeline/exec/es_scan_operator.h
@@ -31,7 +31,7 @@ namespace doris {
 class ExecNode;
 
 namespace vectorized {
-class NewOlapScanner;
+class NewEsScanner;
 }
 } // namespace doris
 
@@ -46,7 +46,7 @@ public:
     EsScanLocalState(RuntimeState* state, OperatorXBase* parent) : Base(state, 
parent) {}
 
 private:
-    friend class vectorized::NewOlapScanner;
+    friend class vectorized::NewEsScanner;
 
     void set_scan_ranges(const std::vector<TScanRangeParams>& scan_ranges) 
override;
     Status _init_profile() override;
diff --git a/be/src/vec/exec/scan/new_es_scanner.cpp 
b/be/src/vec/exec/scan/new_es_scanner.cpp
index 867bbb67cc5..0711e1baea3 100644
--- a/be/src/vec/exec/scan/new_es_scanner.cpp
+++ b/be/src/vec/exec/scan/new_es_scanner.cpp
@@ -22,6 +22,7 @@
 #include <utility>
 
 #include "common/logging.h"
+#include "pipeline/exec/es_scan_operator.h"
 #include "runtime/descriptors.h"
 #include "runtime/runtime_state.h"
 #include "util/runtime_profile.h"
@@ -188,8 +189,9 @@ Status NewEsScanner::_get_block_impl(RuntimeState* state, 
Block* block, bool* eo
 }
 
 Status NewEsScanner::_get_next(std::vector<vectorized::MutableColumnPtr>& 
columns) {
-    NewEsScanNode* new_es_scan_node = static_cast<NewEsScanNode*>(_parent);
-    SCOPED_TIMER(new_es_scan_node->_read_timer);
+    auto read_timer = _parent ? 
static_cast<NewEsScanNode*>(_parent)->_read_timer
+                              : 
_local_state->cast<pipeline::EsScanLocalState>()._read_timer;
+    SCOPED_TIMER(read_timer);
     if (_line_eof && _batch_eof) {
         _es_eof = true;
         return Status::OK();
@@ -204,8 +206,14 @@ Status 
NewEsScanner::_get_next(std::vector<vectorized::MutableColumnPtr>& column
             }
         }
 
-        COUNTER_UPDATE(new_es_scan_node->_rows_read_counter, 1);
-        SCOPED_TIMER(new_es_scan_node->_materialize_timer);
+        auto rows_read_counter =
+                _parent ? 
static_cast<NewEsScanNode*>(_parent)->_rows_read_counter
+                        : 
_local_state->cast<pipeline::EsScanLocalState>()._rows_read_counter;
+        auto materialize_timer =
+                _parent ? 
static_cast<NewEsScanNode*>(_parent)->_materialize_timer
+                        : 
_local_state->cast<pipeline::EsScanLocalState>()._materialize_timer;
+        COUNTER_UPDATE(rows_read_counter, 1);
+        SCOPED_TIMER(materialize_timer);
         RETURN_IF_ERROR(_es_scroll_parser->fill_columns(_tuple_desc, columns, 
&_line_eof,
                                                         _docvalue_context));
         if (!_line_eof) {


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

Reply via email to