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

Method mergeInMemoryRightBlocks

src/Interpreters/MergeJoin.cpp:667–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

665}
666
667void MergeJoin::mergeInMemoryRightBlocks()
668{
669 std::lock_guard lock(rwlock);
670
671 if (right_blocks.empty())
672 return;
673
674 Pipe source(std::make_shared<BlocksListSource>(std::move(right_blocks.blocks)));
675 right_blocks.clear();
676
677 QueryPipelineBuilder builder;
678 builder.init(std::move(source));
679
680 /// TODO: there should be no split keys by blocks for RIGHT|FULL JOIN
681 builder.addTransform(std::make_shared<MergeSortingTransform>(
682 builder.getSharedHeader(),
683 right_sort_description,
684 max_rows_in_right_block,
685 /*max_block_bytes=*/0,
686 /*limit_=*/0,
687 /*increase_sort_description_compile_attempts=*/false,
688 /*max_bytes_before_remerge_*/0,
689 /*remerge_lowered_memory_bytes_ratio_*/0,
690 /*max_bytes_in_block_before_external_sort_*/0,
691 /*max_bytes_in_query_before_external_sort_*/0,
692 /*tmp_data_*/nullptr,
693 /*min_free_disk_space_*/0));
694
695 auto pipeline = QueryPipelineBuilder::getPipeline(std::move(builder));
696 PullingPipelineExecutor executor(pipeline);
697
698 Block block;
699 while (executor.pull(block))
700 {
701 if (!block.rows())
702 continue;
703
704 if (skip_not_intersected)
705 min_max_right_blocks.emplace_back(extractMinMax(block, right_table_keys));
706 right_blocks.countBlockSize(block);
707 loaded_right_blocks.emplace_back(std::make_shared<Block>(std::move(block)));
708 }
709}
710
711void MergeJoin::mergeFlushedRightBlocks()
712{

Callers

nothing calls this directly

Calls 10

extractMinMaxFunction · 0.85
getSharedHeaderMethod · 0.80
countBlockSizeMethod · 0.80
emptyMethod · 0.45
clearMethod · 0.45
initMethod · 0.45
addTransformMethod · 0.45
pullMethod · 0.45
rowsMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected