2019-06-18 12:54:27 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Storages/MergeTree/MergeTreeIndexGranularity.h>
|
|
|
|
#include <Storages/MergeTree/MergeTreeData.h>
|
|
|
|
#include <DataStreams/IBlockOutputStream.h>
|
2019-10-20 23:36:27 +00:00
|
|
|
#include <Storages/MergeTree/IMergeTreeDataPart.h>
|
2019-10-21 15:33:59 +00:00
|
|
|
#include <Storages/MergeTree/IMergeTreeDataPartWriter.h>
|
2019-06-18 12:54:27 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class IMergedBlockOutputStream : public IBlockOutputStream
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
IMergedBlockOutputStream(
|
2020-06-16 15:51:29 +00:00
|
|
|
const MergeTreeDataPartPtr & data_part,
|
|
|
|
const StorageMetadataPtr & metadata_snapshot_);
|
2019-06-18 12:54:27 +00:00
|
|
|
|
|
|
|
using WrittenOffsetColumns = std::set<std::string>;
|
|
|
|
|
2019-11-07 11:11:38 +00:00
|
|
|
const MergeTreeIndexGranularity & getIndexGranularity()
|
|
|
|
{
|
|
|
|
return writer->getIndexGranularity();
|
|
|
|
}
|
|
|
|
|
2019-06-18 12:54:27 +00:00
|
|
|
protected:
|
2021-03-09 14:46:52 +00:00
|
|
|
// using SerializationState = ISerialization::SerializeBinaryBulkStatePtr;
|
2019-06-18 12:54:27 +00:00
|
|
|
|
2021-03-09 14:46:52 +00:00
|
|
|
// ISerialization::OutputStreamGetter createStreamGetter(const String & name, WrittenOffsetColumns & offset_columns);
|
2019-06-18 12:54:27 +00:00
|
|
|
|
2020-03-13 15:09:55 +00:00
|
|
|
/// Remove all columns marked expired in data_part. Also, clears checksums
|
|
|
|
/// and columns array. Return set of removed files names.
|
2020-03-23 02:12:31 +00:00
|
|
|
static NameSet removeEmptyColumnsFromPart(
|
2020-03-13 15:09:55 +00:00
|
|
|
const MergeTreeDataPartPtr & data_part,
|
|
|
|
NamesAndTypesList & columns,
|
|
|
|
MergeTreeData::DataPart::Checksums & checksums);
|
|
|
|
|
2019-06-18 12:54:27 +00:00
|
|
|
protected:
|
2019-10-20 23:36:27 +00:00
|
|
|
const MergeTreeData & storage;
|
2020-06-16 15:51:29 +00:00
|
|
|
StorageMetadataPtr metadata_snapshot;
|
2019-06-18 12:54:27 +00:00
|
|
|
|
2020-05-11 17:20:26 +00:00
|
|
|
VolumePtr volume;
|
2019-07-28 11:10:35 +00:00
|
|
|
String part_path;
|
|
|
|
|
2019-12-18 15:54:45 +00:00
|
|
|
IMergeTreeDataPart::MergeTreeWriterPtr writer;
|
2021-04-15 21:47:11 +00:00
|
|
|
SerializationInfo new_serialization_info;
|
2019-06-18 12:54:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|