2021-04-29 10:03:55 +00:00
|
|
|
#pragma once
|
2021-04-27 17:30:33 +00:00
|
|
|
#include <Processors/QueryPlan/IQueryPlanStep.h>
|
2021-04-28 17:32:12 +00:00
|
|
|
#include <Processors/QueryPlan/ITransformingStep.h>
|
2021-04-27 17:30:33 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class IJoin;
|
|
|
|
using JoinPtr = std::shared_ptr<IJoin>;
|
|
|
|
|
2021-04-29 17:51:35 +00:00
|
|
|
/// Join two data streams.
|
2021-04-27 17:30:33 +00:00
|
|
|
class JoinStep : public IQueryPlanStep
|
|
|
|
{
|
|
|
|
public:
|
2021-04-28 17:32:12 +00:00
|
|
|
JoinStep(
|
2021-04-27 17:30:33 +00:00
|
|
|
const DataStream & left_stream_,
|
|
|
|
const DataStream & right_stream_,
|
|
|
|
JoinPtr join_,
|
2022-04-26 10:06:16 +00:00
|
|
|
size_t max_block_size_);
|
2021-04-27 17:30:33 +00:00
|
|
|
|
|
|
|
String getName() const override { return "Join"; }
|
|
|
|
|
2021-09-14 16:28:41 +00:00
|
|
|
QueryPipelineBuilderPtr updatePipeline(QueryPipelineBuilders pipelines, const BuildQueryPipelineSettings &) override;
|
2021-04-28 17:32:12 +00:00
|
|
|
|
|
|
|
void describePipeline(FormatSettings & settings) const override;
|
2021-04-27 17:30:33 +00:00
|
|
|
|
|
|
|
const JoinPtr & getJoin() const { return join; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
JoinPtr join;
|
2021-04-28 17:32:12 +00:00
|
|
|
size_t max_block_size;
|
|
|
|
Processors processors;
|
|
|
|
};
|
|
|
|
|
2021-04-30 08:25:39 +00:00
|
|
|
/// Special step for the case when Join is already filled.
|
2021-04-29 17:51:35 +00:00
|
|
|
/// For StorageJoin and Dictionary.
|
2021-04-29 09:08:49 +00:00
|
|
|
class FilledJoinStep : public ITransformingStep
|
2021-04-28 17:32:12 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-04-29 09:08:49 +00:00
|
|
|
FilledJoinStep(const DataStream & input_stream_, JoinPtr join_, size_t max_block_size_);
|
2021-04-28 17:32:12 +00:00
|
|
|
|
2021-04-29 09:08:49 +00:00
|
|
|
String getName() const override { return "FilledJoin"; }
|
2021-09-14 16:28:41 +00:00
|
|
|
void transformPipeline(QueryPipelineBuilder & pipeline, const BuildQueryPipelineSettings &) override;
|
2021-04-28 17:32:12 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
JoinPtr join;
|
2021-04-27 17:30:33 +00:00
|
|
|
size_t max_block_size;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|