| 665 | } |
| 666 | |
| 667 | void 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 | |
| 711 | void MergeJoin::mergeFlushedRightBlocks() |
| 712 | { |
nothing calls this directly
no test coverage detected