fix uncaught exception

This commit is contained in:
Nikita Taranov 2024-11-22 23:02:46 +01:00
parent 00f1659601
commit 42df6591aa

View File

@ -302,10 +302,11 @@ struct ScatteredBlock : private boost::noncopyable
/// Cut first `num_rows` rows from `block` in place and returns block with remaining rows
ScatteredBlock cut(size_t num_rows)
{
SCOPE_EXIT(filterBySelector());
if (num_rows >= rows())
{
filterBySelector();
return ScatteredBlock{Block{}};
}
chassert(block);
@ -314,6 +315,7 @@ struct ScatteredBlock : private boost::noncopyable
auto remaining = ScatteredBlock{block, std::move(remaining_selector)};
selector = std::move(first_num_rows);
filterBySelector();
return remaining;
}