2019-06-18 12:54:27 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Storages/MergeTree/IMergedBlockOutputStream.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2019-10-22 17:42:59 +00:00
|
|
|
class MergeTreeDataPartWriterWide;
|
|
|
|
|
2019-06-18 12:54:27 +00:00
|
|
|
/// Writes only those columns that are in `header`
|
|
|
|
class MergedColumnOnlyOutputStream final : public IMergedBlockOutputStream
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/// Pass empty 'already_written_offset_columns' first time then and pass the same object to subsequent instances of MergedColumnOnlyOutputStream
|
|
|
|
/// if you want to serialize elements of Nested data structure in different instances of MergedColumnOnlyOutputStream.
|
|
|
|
MergedColumnOnlyOutputStream(
|
2020-04-17 11:59:10 +00:00
|
|
|
const MergeTreeDataPartPtr & data_part,
|
2020-06-16 15:51:29 +00:00
|
|
|
const StorageMetadataPtr & metadata_snapshot_,
|
2020-04-17 11:59:10 +00:00
|
|
|
const Block & header_,
|
|
|
|
CompressionCodecPtr default_codec_,
|
2019-08-10 20:07:50 +00:00
|
|
|
const std::vector<MergeTreeIndexPtr> & indices_to_recalc_,
|
2019-12-09 21:21:17 +00:00
|
|
|
WrittenOffsetColumns * offset_columns_ = nullptr,
|
2019-11-08 14:36:10 +00:00
|
|
|
const MergeTreeIndexGranularity & index_granularity = {},
|
2020-04-17 11:59:10 +00:00
|
|
|
const MergeTreeIndexGranularityInfo * index_granularity_info_ = nullptr);
|
2019-06-18 12:54:27 +00:00
|
|
|
|
|
|
|
Block getHeader() const override { return header; }
|
|
|
|
void write(const Block & block) override;
|
|
|
|
void writeSuffix() override;
|
2020-03-13 15:09:55 +00:00
|
|
|
MergeTreeData::DataPart::Checksums
|
2020-06-25 16:55:45 +00:00
|
|
|
writeSuffixAndGetChecksums(MergeTreeData::MutableDataPartPtr & new_part, MergeTreeData::DataPart::Checksums & all_checksums, bool sync = false);
|
2019-06-18 12:54:27 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Block header;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|