ClickHouse/dbms/src/Processors/Sources/SourceFromInputStream.h

37 lines
805 B
C++
Raw Normal View History

2019-03-26 18:28:37 +00:00
#pragma once
#include <Processors/ISource.h>
namespace DB
{
2019-04-17 14:38:16 +00:00
class IBlockInputStream;
using BlockInputStreamPtr = std::shared_ptr<IBlockInputStream>;
2019-03-26 18:28:37 +00:00
class SourceFromInputStream : public ISource
{
public:
2019-04-17 14:38:16 +00:00
explicit SourceFromInputStream(BlockInputStreamPtr stream_, bool force_add_aggregating_info = false);
2019-03-26 18:28:37 +00:00
String getName() const override { return "SourceFromInputStream"; }
2019-04-17 14:38:16 +00:00
Status prepare() override;
void work() override;
2019-03-26 18:28:37 +00:00
Chunk generate() override;
2019-04-17 14:38:16 +00:00
IBlockInputStream & getStream() { return *stream; }
void addTotalsPort();
2019-03-26 18:28:37 +00:00
private:
bool has_aggregate_functions = false;
bool force_add_aggregating_info;
2019-04-17 14:38:16 +00:00
BlockInputStreamPtr stream;
Chunk totals;
bool has_totals_port = false;
bool is_stream_finished = false;
bool has_totals = false;
2019-03-26 18:28:37 +00:00
};
}