diff --git a/be/src/exec/olap_scanner.cpp b/be/src/exec/olap_scanner.cpp index 222708e840..80854d6947 100644 --- a/be/src/exec/olap_scanner.cpp +++ b/be/src/exec/olap_scanner.cpp @@ -245,6 +245,7 @@ Status OlapScanner::get_batch( while (true) { // Batch is full, break if (batch->is_full()) { + _update_realtime_counter(); break; } // Read one row from reader @@ -254,6 +255,7 @@ Status OlapScanner::get_batch( } // If we reach end of this scanner, break if (UNLIKELY(*eof)) { + _update_realtime_counter(); break; } @@ -461,6 +463,10 @@ void OlapScanner::update_counter() { _has_update_counter = true; } +void OlapScanner::_update_realtime_counter() { + COUNTER_UPDATE(_parent->bytes_read_counter(), _reader->stats().bytes_read); +} + Status OlapScanner::close(RuntimeState* state) { if (_is_closed) { return Status::OK; diff --git a/be/src/exec/olap_scanner.h b/be/src/exec/olap_scanner.h index 78be097b57..f3e7d86392 100644 --- a/be/src/exec/olap_scanner.h +++ b/be/src/exec/olap_scanner.h @@ -93,6 +93,9 @@ private: Status _init_return_columns(); void _convert_row_to_tuple(Tuple* tuple); + // Update profile that need to be reported in realtime. + void _update_realtime_counter(); + RuntimeState* _runtime_state; OlapScanNode* _parent; const TupleDescriptor* _tuple_desc; /**< tuple descripter */