From bbdac39d2de57e123faaebd2b9e3d8030705500b Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Mon, 17 Feb 2020 14:50:53 +0300 Subject: [PATCH] Fix build. --- dbms/src/Storages/StorageMerge.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/dbms/src/Storages/StorageMerge.cpp b/dbms/src/Storages/StorageMerge.cpp index c14b5db22c1..ef1c44f2380 100644 --- a/dbms/src/Storages/StorageMerge.cpp +++ b/dbms/src/Storages/StorageMerge.cpp @@ -310,14 +310,24 @@ Pipes StorageMerge::createSources(const SelectQueryInfo & query_info, const Quer modified_context.getSettingsRef().max_streams_to_max_threads_ratio = 1; InterpreterSelectQuery interpreter{modified_query_info.query, modified_context, SelectQueryOptions(processed_stage)}; - Pipe pipe = interpreter.executeWithProcessors().getPipe(); + + if (query_info.force_tree_shaped_pipeline) + { + BlockInputStreamPtr stream = std::make_shared(interpreter.execute().in); + Pipe pipe(std::make_shared(std::move(stream))); + pipes.emplace_back(std::move(pipe)); + } + else + { + Pipe pipe = interpreter.executeWithProcessors().getPipe(); + pipes.emplace_back(std::move(pipe)); + } /** Materialization is needed, since from distributed storage the constants come materialized. * If you do not do this, different types (Const and non-Const) columns will be produced in different threads, * And this is not allowed, since all code is based on the assumption that in the block stream all types are the same. */ - pipe.addSimpleTransform(std::make_shared(pipe.getHeader())); - pipes.emplace_back(std::move(pipe)); + pipes.back().addSimpleTransform(std::make_shared(pipes.back().getHeader())); } if (!pipes.empty())