Fix bug that ScanBytes is when collect executing query's infos (#869)
This commit is contained in:
@ -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;
|
||||
|
||||
@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user