MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / loadRightBlock

Method loadRightBlock

src/Interpreters/MergeJoin.cpp:1156–1176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1154
1155template <bool in_memory>
1156std::shared_ptr<Block> MergeJoin::loadRightBlock(size_t pos) const
1157{
1158 if constexpr (!in_memory)
1159 {
1160 auto load_func = [&]() -> std::shared_ptr<Block>
1161 {
1162 auto input = flushed_right_blocks[pos].getReadStream();
1163 auto result = std::make_shared<Block>(input->read());
1164 if (Block eof_block = input->read(); !eof_block.empty())
1165 {
1166 throw Exception(ErrorCodes::LOGICAL_ERROR, "Expected one block per file, got block {} in file {}",
1167 eof_block.dumpStructure(), flushed_right_blocks[pos].getHolder()->describeFilePath());
1168 }
1169 return result;
1170 };
1171
1172 return cached_right_blocks->getOrSet(pos, load_func).first;
1173 }
1174 else
1175 return loaded_right_blocks[pos];
1176}
1177
1178void MergeJoin::initRightTableWriter()
1179{

Callers

nothing calls this directly

Calls 8

getReadStreamMethod · 0.80
getHolderMethod · 0.80
ExceptionClass · 0.70
readMethod · 0.45
emptyMethod · 0.45
dumpStructureMethod · 0.45
describeFilePathMethod · 0.45
getOrSetMethod · 0.45

Tested by

no test coverage detected