#pragma once #include #include #include #include #include "Storages/MergeTree/AlterConversions.h" #include "Storages/MergeTree/MergeTreePartInfo.h" namespace DB { class IMergeTreeDataPart; using DataPartPtr = std::shared_ptr; /// The only purpose of this struct is that serialize and deserialize methods /// they look natural here because we can fully serialize and then deserialize original DataPart class. struct RangesInDataPartDescription { MergeTreePartInfo info; MarkRanges ranges; void serialize(WriteBuffer & out) const; String describe() const; void deserialize(ReadBuffer & in); }; struct RangesInDataPartsDescription: public std::deque { using std::deque::deque; void serialize(WriteBuffer & out) const; String describe() const; void deserialize(ReadBuffer & in); void merge(RangesInDataPartsDescription & other); }; struct RangesInDataPart { DataPartPtr data_part; AlterConversionsPtr alter_conversions; size_t part_index_in_query; MarkRanges ranges; RangesInDataPart() = default; RangesInDataPart( const DataPartPtr & data_part_, const AlterConversionsPtr & alter_conversions_, const size_t part_index_in_query_, const MarkRanges & ranges_ = MarkRanges{}) : data_part{data_part_} , alter_conversions{alter_conversions_} , part_index_in_query{part_index_in_query_} , ranges{ranges_} {} RangesInDataPartDescription getDescription() const; size_t getMarksCount() const; size_t getRowsCount() const; }; struct RangesInDataParts: public std::vector { using std::vector::vector; RangesInDataPartsDescription getDescriptions() const; size_t getMarksCountAllParts() const; size_t getRowsCountAllParts() const; }; }