From 42df6591aa70b4c1737b104fafc428a91df34447 Mon Sep 17 00:00:00 2001 From: Nikita Taranov Date: Fri, 22 Nov 2024 23:02:46 +0100 Subject: [PATCH] fix uncaught exception --- src/Interpreters/HashJoin/ScatteredBlock.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Interpreters/HashJoin/ScatteredBlock.h b/src/Interpreters/HashJoin/ScatteredBlock.h index 729377f6758..31ff773d04d 100644 --- a/src/Interpreters/HashJoin/ScatteredBlock.h +++ b/src/Interpreters/HashJoin/ScatteredBlock.h @@ -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; }