| 1154 | |
| 1155 | template <bool in_memory> |
| 1156 | std::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 | |
| 1178 | void MergeJoin::initRightTableWriter() |
| 1179 | { |
nothing calls this directly
no test coverage detected