mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-11 02:50:50 +00:00
37 lines
805 B
C++
37 lines
805 B
C++
#pragma once
|
|
#include <Processors/ISource.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class IBlockInputStream;
|
|
using BlockInputStreamPtr = std::shared_ptr<IBlockInputStream>;
|
|
|
|
class SourceFromInputStream : public ISource
|
|
{
|
|
public:
|
|
explicit SourceFromInputStream(BlockInputStreamPtr stream_, bool force_add_aggregating_info = false);
|
|
String getName() const override { return "SourceFromInputStream"; }
|
|
|
|
Status prepare() override;
|
|
void work() override;
|
|
|
|
Chunk generate() override;
|
|
|
|
IBlockInputStream & getStream() { return *stream; }
|
|
|
|
void addTotalsPort();
|
|
|
|
private:
|
|
bool has_aggregate_functions = false;
|
|
bool force_add_aggregating_info;
|
|
BlockInputStreamPtr stream;
|
|
|
|
Chunk totals;
|
|
bool has_totals_port = false;
|
|
bool is_stream_finished = false;
|
|
bool has_totals = false;
|
|
};
|
|
|
|
}
|