2019-10-16 18:27:53 +00:00
|
|
|
#include <Storages/MergeTree/IMergeTreeDataPartWriter.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2019-10-22 10:50:17 +00:00
|
|
|
class MergeTreeDataPartWriterCompact : public IMergeTreeDataPartWriter
|
2019-10-16 18:27:53 +00:00
|
|
|
{
|
|
|
|
public:
|
2019-10-22 10:50:17 +00:00
|
|
|
MergeTreeDataPartWriterCompact(
|
|
|
|
const String & part_path,
|
|
|
|
const MergeTreeData & storage,
|
|
|
|
const NamesAndTypesList & columns_list,
|
|
|
|
const String & marks_file_extension,
|
|
|
|
const CompressionCodecPtr & default_codec,
|
|
|
|
const WriterSettings & settings);
|
|
|
|
|
2019-10-21 17:23:06 +00:00
|
|
|
size_t write(const Block & block, const IColumn::Permutation * permutation,
|
|
|
|
size_t from_mark, size_t index_offset, const MergeTreeIndexGranularity & index_granularity,
|
2019-10-16 18:27:53 +00:00
|
|
|
const Block & primary_key_block, const Block & skip_indexes_block) override;
|
|
|
|
|
2019-10-21 17:23:06 +00:00
|
|
|
void finalize(IMergeTreeDataPart::Checksums & checksums, bool write_final_mark) override;
|
|
|
|
|
|
|
|
private:
|
2019-10-16 18:27:53 +00:00
|
|
|
/// Write single granule of one column (rows between 2 marks)
|
|
|
|
size_t writeColumnSingleGranule(
|
|
|
|
const ColumnWithTypeAndName & column,
|
|
|
|
size_t from_row,
|
|
|
|
size_t number_of_rows);
|
2019-10-21 17:23:06 +00:00
|
|
|
|
2019-10-21 00:28:29 +00:00
|
|
|
ColumnStreamPtr stream;
|
2019-10-16 18:27:53 +00:00
|
|
|
};
|
|
|
|
|
2019-10-21 15:33:59 +00:00
|
|
|
}
|