This commit is contained in:
Nikita Taranov 2024-10-31 22:17:10 +01:00
parent 63e9204c52
commit 204f723638

View File

@ -116,7 +116,7 @@ IProcessor::Status JoiningTransform::prepare()
return Status::NeedData;
input_chunk = input.pull(true);
has_input = true;
has_input = input_chunk.hasRows() || on_totals;
return Status::Ready;
}
@ -155,8 +155,11 @@ void JoiningTransform::work()
return;
}
output_chunks.emplace_back(block.getColumns(), block.rows());
has_output = true;
if (block.rows())
{
output_chunks.emplace_back(block.getColumns(), block.rows());
has_output = true;
}
}
}
@ -190,9 +193,15 @@ void JoiningTransform::transform(Chunk & chunk)
JoinCommon::joinTotals(left_totals, right_totals, join->getTableJoin(), res.back());
}
else
{
res = readExecute(chunk);
}
std::ranges::for_each(res, [this](Block & block) { output_chunks.emplace_back(block.getColumns(), block.rows()); });
for (const auto & block : res)
{
if (block.rows())
output_chunks.emplace_back(block.getColumns(), block.rows());
}
}
Blocks JoiningTransform::readExecute(Chunk & chunk)