Fix bug that ScanBytes is when collect executing query's infos (#869)

This commit is contained in:
chenhao
2019-04-03 18:27:50 +08:00
committed by ZHAO Chun
parent d5a6d1cc6f
commit c0fbc84381
2 changed files with 9 additions and 0 deletions

View File

@ -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;

View File

@ -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 */