diff --git a/src/Processors/QueryPlan/JoinStep.cpp b/src/Processors/QueryPlan/JoinStep.cpp index 4e5dafb197b..d7ccf003937 100644 --- a/src/Processors/QueryPlan/JoinStep.cpp +++ b/src/Processors/QueryPlan/JoinStep.cpp @@ -38,7 +38,14 @@ QueryPipelineBuilderPtr JoinStep::updatePipeline(QueryPipelineBuilders pipelines std::move(pipelines[0]), std::move(pipelines[1]), join, output_stream->header, max_block_size, &processors); return QueryPipelineBuilder::joinPipelinesRightLeft( - std::move(pipelines[0]), std::move(pipelines[1]), join, max_block_size, max_streams, keep_left_read_in_order, &processors); + std::move(pipelines[0]), + std::move(pipelines[1]), + join, + output_stream->header, + max_block_size, + max_streams, + keep_left_read_in_order, + &processors); } void JoinStep::describePipeline(FormatSettings & settings) const diff --git a/src/QueryPipeline/QueryPipelineBuilder.cpp b/src/QueryPipeline/QueryPipelineBuilder.cpp index 700ef947882..88a52defa1e 100644 --- a/src/QueryPipeline/QueryPipelineBuilder.cpp +++ b/src/QueryPipeline/QueryPipelineBuilder.cpp @@ -361,6 +361,7 @@ std::unique_ptr QueryPipelineBuilder::joinPipelinesRightLe std::unique_ptr left, std::unique_ptr right, JoinPtr join, + const Block & output_header, size_t max_block_size, size_t max_streams, bool keep_left_read_in_order, @@ -448,7 +449,6 @@ std::unique_ptr QueryPipelineBuilder::joinPipelinesRightLe auto lit = left->pipe.output_ports.begin(); auto rit = right->pipe.output_ports.begin(); - auto output_header = JoiningTransform::transformHeader(left->getHeader(), join); for (size_t i = 0; i < num_streams; ++i) { auto joining = std::make_shared( diff --git a/src/QueryPipeline/QueryPipelineBuilder.h b/src/QueryPipeline/QueryPipelineBuilder.h index 18e9d718445..2d9b8028627 100644 --- a/src/QueryPipeline/QueryPipelineBuilder.h +++ b/src/QueryPipeline/QueryPipelineBuilder.h @@ -114,6 +114,7 @@ public: std::unique_ptr left, std::unique_ptr right, JoinPtr join, + const Block & output_header, size_t max_block_size, size_t max_streams, bool keep_left_read_in_order,