| 735 | } |
| 736 | |
| 737 | MergeTreeMetaBase::MutableDataPartPtr MergeTreeDataWriter::writeTempProjectionPart( |
| 738 | MergeTreeMetaBase & data, |
| 739 | Poco::Logger * log, |
| 740 | Block block, |
| 741 | const ProjectionDescription & projection, |
| 742 | const IMergeTreeDataPart * parent_part, |
| 743 | size_t block_num, |
| 744 | IStorage::StorageLocation write_location) |
| 745 | { |
| 746 | /// Size of part would not be greater than block.bytes() + epsilon |
| 747 | size_t expected_size = block.bytes(); |
| 748 | |
| 749 | // just check if there is enough space on parent volume |
| 750 | ReservationPtr reservation = data.reserveSpace(expected_size, parent_part->volume); |
| 751 | |
| 752 | String part_name = fmt::format("{}_{}", projection.name, block_num); |
| 753 | MergeTreePartInfo new_part_info("all", 0, 0, 0); |
| 754 | auto new_data_part = data.createPart( |
| 755 | part_name, |
| 756 | data.choosePartType(expected_size, block.rows()), |
| 757 | new_part_info, |
| 758 | parent_part->volume, |
| 759 | "tmp_insert_" + part_name + ".proj", |
| 760 | parent_part, |
| 761 | write_location); |
| 762 | new_data_part->is_temp = true; // It's part for merge |
| 763 | |
| 764 | return writeProjectionPartImpl(data, log, block, projection.metadata, std::move(new_data_part)); |
| 765 | } |
| 766 | |
| 767 | } |
nothing calls this directly
no test coverage detected