2016-07-01 21:02:13 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-01-23 14:48:50 +00:00
|
|
|
#include <DataStreams/IBlockInputStream.h>
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <DataStreams/SquashingTransform.h>
|
2016-07-01 21:02:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2016-07-07 01:57:48 +00:00
|
|
|
/** Merging consecutive blocks of stream to specified minimum size.
|
2016-07-01 21:02:13 +00:00
|
|
|
*/
|
2019-01-23 14:48:50 +00:00
|
|
|
class SquashingBlockInputStream : public IBlockInputStream
|
2016-07-01 21:02:13 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-10-13 19:13:41 +00:00
|
|
|
SquashingBlockInputStream(const BlockInputStreamPtr & src, size_t min_block_size_rows, size_t min_block_size_bytes);
|
2016-07-01 21:02:13 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
String getName() const override { return "Squashing"; }
|
2016-07-01 21:02:13 +00:00
|
|
|
|
2018-09-09 02:23:24 +00:00
|
|
|
Block getHeader() const override { return header; }
|
2018-01-06 18:10:44 +00:00
|
|
|
|
2016-07-01 21:02:13 +00:00
|
|
|
protected:
|
2017-04-01 07:20:54 +00:00
|
|
|
Block readImpl() override;
|
2016-07-01 21:02:13 +00:00
|
|
|
|
|
|
|
private:
|
2018-09-09 02:23:24 +00:00
|
|
|
Block header;
|
2017-04-01 07:20:54 +00:00
|
|
|
SquashingTransform transform;
|
|
|
|
bool all_read = false;
|
2016-07-01 21:02:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|