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:
|
2019-04-05 15:45:46 +00:00
|
|
|
bool has_aggregate_functions = false;
|
2019-04-12 13:09:36 +00:00
|
|
|
bool force_add_aggregating_info;
|
2019-04-17 14:38:16 +00:00
|
|
|
BlockInputStreamPtr stream;
|
|
|
|
|
|
|
|
Chunk totals;
|
|
|
|
bool has_totals_port = false;
|
|
|
|
bool has_totals = false;
|
2019-04-17 16:14:52 +00:00
|
|
|
|
|
|
|
bool is_generating_finished = false;
|
|
|
|
bool is_stream_finished = false;
|
2019-04-25 13:34:59 +00:00
|
|
|
bool is_stream_started = false;
|
2019-03-26 18:28:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|