Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement](scan) use loop to instead recursion on Level1Iterator::_normal_next #38005 #45767

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading