2020-06-17 15:50:21 +00:00
|
|
|
#pragma once
|
2021-04-10 23:33:54 +00:00
|
|
|
|
2020-06-17 15:50:21 +00:00
|
|
|
#include <Processors/QueryPlan/ITransformingStep.h>
|
2021-10-15 20:18:20 +00:00
|
|
|
#include <QueryPipeline/SizeLimits.h>
|
2021-04-10 23:33:54 +00:00
|
|
|
#include <Interpreters/Context_fwd.h>
|
2022-07-18 15:53:30 +00:00
|
|
|
#include <Interpreters/PreparedSets.h>
|
2020-06-17 15:50:21 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2020-06-22 10:18:28 +00:00
|
|
|
/// Creates sets for subqueries and JOIN. See CreatingSetsTransform.
|
2021-04-10 23:33:54 +00:00
|
|
|
class CreatingSetStep : public ITransformingStep, WithContext
|
2020-06-17 15:50:21 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-09-15 13:25:14 +00:00
|
|
|
CreatingSetStep(
|
2020-06-17 15:50:21 +00:00
|
|
|
const DataStream & input_stream_,
|
2020-09-15 13:25:14 +00:00
|
|
|
String description_,
|
|
|
|
SubqueryForSet subquery_for_set_,
|
2020-06-17 15:50:21 +00:00
|
|
|
SizeLimits network_transfer_limits_,
|
2021-04-10 23:33:54 +00:00
|
|
|
ContextPtr context_);
|
2020-06-17 15:50:21 +00:00
|
|
|
|
2020-09-15 17:13:13 +00:00
|
|
|
String getName() const override { return "CreatingSet"; }
|
2020-06-17 15:50:21 +00:00
|
|
|
|
2021-09-14 16:28:41 +00:00
|
|
|
void transformPipeline(QueryPipelineBuilder & pipeline, const BuildQueryPipelineSettings &) override;
|
2020-06-17 15:50:21 +00:00
|
|
|
|
2021-04-16 16:36:59 +00:00
|
|
|
void describeActions(JSONBuilder::JSONMap & map) const override;
|
2020-06-27 14:02:24 +00:00
|
|
|
void describeActions(FormatSettings & settings) const override;
|
2020-06-24 12:09:01 +00:00
|
|
|
|
2020-06-17 15:50:21 +00:00
|
|
|
private:
|
2022-06-27 11:16:52 +00:00
|
|
|
void updateOutputStream() override;
|
|
|
|
|
2020-09-15 13:25:14 +00:00
|
|
|
String description;
|
|
|
|
SubqueryForSet subquery_for_set;
|
2020-06-17 15:50:21 +00:00
|
|
|
SizeLimits network_transfer_limits;
|
|
|
|
};
|
|
|
|
|
2020-09-15 13:25:14 +00:00
|
|
|
class CreatingSetsStep : public IQueryPlanStep
|
|
|
|
{
|
|
|
|
public:
|
2021-03-04 17:38:12 +00:00
|
|
|
explicit CreatingSetsStep(DataStreams input_streams_);
|
2020-09-15 13:25:14 +00:00
|
|
|
|
|
|
|
String getName() const override { return "CreatingSets"; }
|
|
|
|
|
2021-09-14 16:28:41 +00:00
|
|
|
QueryPipelineBuilderPtr updatePipeline(QueryPipelineBuilders pipelines, const BuildQueryPipelineSettings &) override;
|
2020-09-15 13:25:14 +00:00
|
|
|
|
|
|
|
void describePipeline(FormatSettings & settings) const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Processors processors;
|
|
|
|
};
|
|
|
|
|
2022-07-27 11:22:16 +00:00
|
|
|
void addCreatingSetsStep(QueryPlan & query_plan, PreparedSetsPtr prepared_sets, ContextPtr context);
|
2020-09-15 17:13:13 +00:00
|
|
|
|
2020-06-17 15:50:21 +00:00
|
|
|
}
|