2019-01-30 12:01:00 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-02-10 15:50:12 +00:00
|
|
|
#include <Core/Block.h>
|
|
|
|
#include <Storages/IStorage_fwd.h>
|
2019-01-30 12:01:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2020-09-15 13:25:14 +00:00
|
|
|
class QueryPlan;
|
2019-01-30 12:01:00 +00:00
|
|
|
|
2021-04-29 14:34:52 +00:00
|
|
|
class Set;
|
|
|
|
using SetPtr = std::shared_ptr<Set>;
|
|
|
|
|
2019-01-30 12:01:00 +00:00
|
|
|
/// Information on what to do when executing a subquery in the [GLOBAL] IN/JOIN section.
|
|
|
|
struct SubqueryForSet
|
|
|
|
{
|
2021-04-29 14:58:58 +00:00
|
|
|
SubqueryForSet();
|
2020-09-15 17:13:13 +00:00
|
|
|
~SubqueryForSet();
|
2021-04-29 14:58:58 +00:00
|
|
|
SubqueryForSet(SubqueryForSet &&);
|
|
|
|
SubqueryForSet & operator= (SubqueryForSet &&);
|
2020-09-15 17:13:13 +00:00
|
|
|
|
2019-01-30 12:01:00 +00:00
|
|
|
/// The source is obtained using the InterpreterSelectQuery subquery.
|
2020-09-15 13:25:14 +00:00
|
|
|
std::unique_ptr<QueryPlan> source;
|
2019-01-30 12:01:00 +00:00
|
|
|
|
|
|
|
/// If set, build it from result.
|
|
|
|
SetPtr set;
|
|
|
|
|
|
|
|
/// If set, put the result into the table.
|
|
|
|
/// This is a temporary table for transferring to remote servers for distributed query processing.
|
|
|
|
StoragePtr table;
|
|
|
|
};
|
|
|
|
|
|
|
|
/// ID of subquery -> what to do with it.
|
|
|
|
using SubqueriesForSets = std::unordered_map<String, SubqueryForSet>;
|
|
|
|
|
|
|
|
}
|