ClickHouse/dbms/src/Interpreters/InterpreterSelectWithUnionQuery.h

54 lines
1.2 KiB
C++
Raw Normal View History

2018-02-25 00:50:53 +00:00
#pragma once
#include <Core/QueryProcessingStage.h>
#include <Interpreters/Context.h>
#include <Interpreters/IInterpreter.h>
namespace DB
{
class InterpreterSelectQuery;
/** Interprets one or multiple SELECT queries inside UNION ALL chain.
*/
class InterpreterSelectWithUnionQuery : public IInterpreter
{
public:
InterpreterSelectWithUnionQuery(
const ASTPtr & query_ptr_,
const Context & context_,
2018-02-27 20:16:58 +00:00
const Names & required_result_column_names = Names{},
2018-02-25 00:50:53 +00:00
QueryProcessingStage::Enum to_stage_ = QueryProcessingStage::Complete,
size_t subquery_depth_ = 0,
bool only_analyze = false);
2018-02-25 00:50:53 +00:00
~InterpreterSelectWithUnionQuery() override;
2018-02-25 00:50:53 +00:00
BlockIO execute() override;
/// Execute the query without union of streams.
BlockInputStreams executeWithMultipleStreams();
Block getSampleBlock();
static Block getSampleBlock(
const ASTPtr & query_ptr_,
const Context & context_);
2018-02-25 06:34:20 +00:00
void ignoreWithTotals();
2018-02-25 00:50:53 +00:00
private:
ASTPtr query_ptr;
Context context;
QueryProcessingStage::Enum to_stage;
size_t subquery_depth;
std::vector<std::unique_ptr<InterpreterSelectQuery>> nested_interpreters;
2018-02-26 06:12:59 +00:00
Block result_header;
2018-02-25 00:50:53 +00:00
};
}