ClickHouse/dbms/src/DataStreams/BlockExtraInfoInputStream.h

47 lines
1.0 KiB
C++
Raw Normal View History

2015-10-12 14:53:16 +00:00
#pragma once
#include <DataStreams/IProfilingBlockInputStream.h>
2015-10-12 14:53:16 +00:00
namespace DB
{
/** Adds to one stream additional block information that is specified
2017-05-13 22:19:04 +00:00
* as the constructor parameter.
2015-10-12 14:53:16 +00:00
*/
class BlockExtraInfoInputStream : public IProfilingBlockInputStream
{
public:
BlockExtraInfoInputStream(const BlockInputStreamPtr & input, const BlockExtraInfo & block_extra_info_)
: block_extra_info(block_extra_info_)
{
children.push_back(input);
}
BlockExtraInfo getBlockExtraInfo() const override
{
return block_extra_info;
}
String getName() const override { return "BlockExtraInfoInput"; }
String getID() const override
{
std::stringstream res;
res << "BlockExtraInfoInput(" << children.back()->getID() << ")";
return res.str();
}
2015-10-12 14:53:16 +00:00
Block getHeader() override { return children.back()->getHeader(); }
2015-10-12 14:53:16 +00:00
protected:
Block readImpl() override
{
return children.back()->read();
}
2015-10-12 14:53:16 +00:00
private:
BlockExtraInfo block_extra_info;
2015-10-12 14:53:16 +00:00
};
}