1 | #pragma once |
---|---|
2 | |
3 | #include <DataStreams/IBlockInputStream.h> |
4 | #include <DataStreams/SquashingTransform.h> |
5 | |
6 | |
7 | namespace DB |
8 | { |
9 | |
10 | /** Merging consecutive blocks of stream to specified minimum size. |
11 | */ |
12 | class SquashingBlockInputStream : public IBlockInputStream |
13 | { |
14 | public: |
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 | |
22 | protected: |
23 | Block readImpl() override; |
24 | |
25 | private: |
26 | Block header; |
27 | SquashingTransform transform; |
28 | bool all_read = false; |
29 | }; |
30 | |
31 | } |
32 |