From 69e9dd9b3dff6ba787cb5e3cb44c705ff61228a0 Mon Sep 17 00:00:00 2001 From: Nikita Taranov Date: Wed, 23 Oct 2024 15:07:49 +0100 Subject: [PATCH] fix --- src/Interpreters/ConcurrentHashJoin.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Interpreters/ConcurrentHashJoin.cpp b/src/Interpreters/ConcurrentHashJoin.cpp index f2d1d1418a4..88559e26c71 100644 --- a/src/Interpreters/ConcurrentHashJoin.cpp +++ b/src/Interpreters/ConcurrentHashJoin.cpp @@ -246,8 +246,13 @@ void ConcurrentHashJoin::joinBlock(Block & block, std::vector & res, std: chassert(res.empty()); res.clear(); res.reserve(dispatched_blocks.size()); - std::ranges::transform( - dispatched_blocks, std::back_inserter(res), [](ScatteredBlock & res_block) { return std::move(res_block).getSourceBlock(); }); + for (auto && res_block : dispatched_blocks) + { + if (res_block.rows()) + res.emplace_back(std::move(res_block).getSourceBlock()); + } + if (res.empty()) + res.emplace_back(dispatched_blocks[0].getSourceBlock()); } void ConcurrentHashJoin::checkTypesOfKeys(const Block & block) const