Skip to content

Commit

Permalink
[Improvement](scan) use loop to instead recursion on Level1Iterator::…
Browse files Browse the repository at this point in the history
…_normal_next #38005 (#45767)

pick from  #38005
  • Loading branch information
BiteTheDDDDt authored Dec 23, 2024
1 parent fe3632a commit d70c17b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions be/src/vec/olap/vcollect_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,20 +865,20 @@ Status VCollectIterator::Level1Iterator::_merge_next(Block* block) {
Status VCollectIterator::Level1Iterator::_normal_next(Block* block) {
SCOPED_RAW_TIMER(&_reader->_stats.collect_iterator_normal_next_timer);
auto res = _cur_child->next(block);

while (res.is<END_OF_FILE>() && !_children.empty()) {
_cur_child = std::move(*(_children.begin()));
_children.pop_front();
// clear TEMP columns to avoid column align problem
block->erase_tmp_columns();
res = _cur_child->next(block);
}

if (LIKELY(res.ok())) {
return Status::OK();
} else if (res.is<END_OF_FILE>()) {
// current child has been read, to read next
if (!_children.empty()) {
_cur_child = std::move(*(_children.begin()));
_children.pop_front();
// clear TEMP columns to avoid column align problem
block->erase_tmp_columns();
return _normal_next(block);
} else {
_cur_child.reset();
return Status::Error<END_OF_FILE>("");
}
_cur_child.reset();
return Status::Error<END_OF_FILE>("");
} else {
_cur_child.reset();
LOG(WARNING) << "failed to get next from child, res=" << res;
Expand Down

0 comments on commit d70c17b

Please sign in to comment.