ClickHouse/src/Processors/QueryPlan/JoinStep.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

67 lines
1.7 KiB
C++
Raw Normal View History

2021-04-29 10:03:55 +00:00
#pragma once
2022-07-07 08:28:06 +00:00
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_,
size_t max_block_size_,
size_t max_streams_,
bool keep_left_read_in_order_);
2021-04-27 17:30:33 +00:00
String getName() const override { return "Join"; }
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
2023-08-03 15:55:15 +00:00
void describeActions(JSONBuilder::JSONMap & map) const override;
void describeActions(FormatSettings & settings) const override;
2021-04-27 17:30:33 +00:00
const JoinPtr & getJoin() const { return join; }
bool allowPushDownToRight() const;
2021-04-27 17:30:33 +00:00
bool canUpdateInputStream() const override { return true; }
2021-04-27 17:30:33 +00:00
private:
void updateOutputStream() override;
2021-04-27 17:30:33 +00:00
JoinPtr join;
2021-04-28 17:32:12 +00:00
size_t max_block_size;
size_t max_streams;
bool keep_left_read_in_order;
2021-04-28 17:32:12 +00:00
};
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"; }
void transformPipeline(QueryPipelineBuilder & pipeline, const BuildQueryPipelineSettings &) override;
2021-04-28 17:32:12 +00:00
const JoinPtr & getJoin() const { return join; }
2021-04-28 17:32:12 +00:00
private:
void updateOutputStream() override;
2021-04-28 17:32:12 +00:00
JoinPtr join;
2021-04-27 17:30:33 +00:00
size_t max_block_size;
};
}