ClickHouse/src/Storages/MergeTree/RangesInDataPart.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

74 lines
1.8 KiB
C++
Raw Normal View History

2015-06-24 11:03:53 +00:00
#pragma once
2023-02-03 13:34:18 +00:00
#include <vector>
#include <IO/WriteBuffer.h>
#include <IO/ReadBuffer.h>
#include <Storages/MergeTree/MarkRange.h>
2023-02-03 13:34:18 +00:00
#include "Storages/MergeTree/MergeTreePartInfo.h"
2015-06-24 11:03:53 +00:00
namespace DB
{
2023-02-03 13:34:18 +00:00
class IMergeTreeDataPart;
using DataPartPtr = std::shared_ptr<const IMergeTreeDataPart>;
/// 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<RangesInDataPartDescription>
{
using std::deque<RangesInDataPartDescription>::deque;
void serialize(WriteBuffer & out) const;
String describe() const;
void deserialize(ReadBuffer & in);
void merge(RangesInDataPartsDescription & other);
};
2015-06-24 11:03:53 +00:00
struct RangesInDataPart
{
2023-02-03 13:34:18 +00:00
DataPartPtr data_part;
ColumnConst unification (#1011) * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * Fixed error in ColumnArray::replicateGeneric [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150].
2017-07-21 06:35:58 +00:00
size_t part_index_in_query;
2015-06-24 11:03:53 +00:00
MarkRanges ranges;
RangesInDataPart() = default;
2023-02-03 13:34:18 +00:00
RangesInDataPart(
const DataPartPtr & data_part_,
const size_t part_index_in_query_,
const MarkRanges & ranges_ = MarkRanges{})
: data_part{data_part_}
, part_index_in_query{part_index_in_query_}
, ranges{ranges_}
{}
RangesInDataPartDescription getDescription() const;
size_t getMarksCount() const;
size_t getRowsCount() const;
2015-06-24 11:03:53 +00:00
};
2023-02-03 13:34:18 +00:00
struct RangesInDataParts: public std::vector<RangesInDataPart>
{
using std::vector<RangesInDataPart>::vector;
RangesInDataPartsDescription getDescriptions() const;
size_t getMarksCountAllParts() const;
size_t getRowsCountAllParts() const;
};
2015-06-24 11:03:53 +00:00
}