2016-07-01 21:02:13 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DB/DataStreams/IProfilingBlockInputStream.h>
|
2016-07-06 21:48:11 +00:00
|
|
|
#include <DB/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
|
|
|
*/
|
|
|
|
class SquashingBlockInputStream : public IProfilingBlockInputStream
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SquashingBlockInputStream(BlockInputStreamPtr & src, size_t min_block_size_rows, size_t min_block_size_bytes);
|
|
|
|
|
|
|
|
String getName() const override { return "Squashing"; }
|
|
|
|
|
|
|
|
String getID() const override
|
|
|
|
{
|
|
|
|
std::stringstream res;
|
|
|
|
res << "Squashing(" << children.at(0)->getID() << ")";
|
|
|
|
return res.str();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
Block readImpl() override;
|
|
|
|
|
|
|
|
private:
|
2016-07-06 21:48:11 +00:00
|
|
|
SquashingTransform transform;
|
2016-07-07 01:57:48 +00:00
|
|
|
bool all_read = false;
|
2016-07-01 21:02:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|