1#pragma once
2
3#include <DataStreams/IBlockInputStream.h>
4#include <DataStreams/SquashingTransform.h>
5
6
7namespace DB
8{
9
10/** Merging consecutive blocks of stream to specified minimum size.
11 */
12class SquashingBlockInputStream : public IBlockInputStream
13{
14public:
15 SquashingBlockInputStream(const BlockInputStreamPtr & src, size_t min_block_size_rows, size_t min_block_size_bytes,
16 bool reserve_memory = false);
17
18 String getName() const override { return "Squashing"; }
19
20 Block getHeader() const override { return header; }
21
22protected:
23 Block readImpl() override;
24
25private:
26 Block header;
27 SquashingTransform transform;
28 bool all_read = false;
29};
30
31}
32