2020-04-14 19:47:19 +00:00
|
|
|
#include <Storages/MergeTree/IMergeTreeDataPartWriter.h>
|
|
|
|
#include <Storages/MergeTree/MergeTreeDataPartInMemory.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/// Writes data part in memory.
|
|
|
|
class MergeTreeDataPartWriterInMemory : public IMergeTreeDataPartWriter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MergeTreeDataPartWriterInMemory(
|
|
|
|
const DataPartInMemoryPtr & part_,
|
|
|
|
const NamesAndTypesList & columns_list_,
|
|
|
|
const MergeTreeWriterSettings & settings_);
|
|
|
|
|
2020-06-03 13:27:54 +00:00
|
|
|
/// You can write only one block. In-memory part can be written only at INSERT.
|
2020-04-14 19:47:19 +00:00
|
|
|
void write(const Block & block, const IColumn::Permutation * permutation,
|
|
|
|
const Block & primary_key_block, const Block & skip_indexes_block) override;
|
|
|
|
|
|
|
|
void finishDataSerialization(IMergeTreeDataPart::Checksums & checksums) override;
|
|
|
|
|
|
|
|
void calculateAndSerializePrimaryIndex(const Block & primary_index_block) override;
|
|
|
|
|
|
|
|
private:
|
2020-06-03 13:27:54 +00:00
|
|
|
DataPartInMemoryPtr part_in_memory;
|
2020-04-14 19:47:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|