fix tests

This commit is contained in:
Sema Checherinda 2024-05-01 18:21:32 +02:00
parent f1493a40a4
commit fa667b4543
2 changed files with 8 additions and 3 deletions

View File

@ -12,7 +12,6 @@
#include <Common/FailPoint.h>
#include <Common/thread_local_rng.h>
#include <Common/typeid_cast.h>
#include "Processors/Chunk.h"
#include <DataTypes/DataTypesNumber.h>
#include <DataTypes/DataTypeString.h>
@ -24,6 +23,7 @@
#include <Parsers/ASTCheckQuery.h>
#include <Parsers/ASTSetQuery.h>
#include <Processors/Chunk.h>
#include <Processors/IAccumulatingTransform.h>
#include <Processors/IInflatingTransform.h>
#include <Processors/ISimpleTransform.h>

View File

@ -16,6 +16,7 @@
#include <Interpreters/getTableExpressions.h>
#include <Interpreters/processColumnTransformers.h>
#include <Interpreters/InterpreterSelectQueryAnalyzer.h>
#include <Interpreters/Context_fwd.h>
#include <Parsers/ASTFunction.h>
#include <Parsers/ASTInsertQuery.h>
#include <Parsers/ASTSelectQuery.h>
@ -38,7 +39,6 @@
#include <Common/ThreadStatus.h>
#include <Common/checkStackSize.h>
#include <Common/ProfileEvents.h>
#include "Interpreters/Context_fwd.h"
namespace ProfileEvents
@ -682,6 +682,7 @@ QueryPipeline InterpreterInsertQuery::buildInsertPipeline()
chain.addSource(std::move(counting));
QueryPipeline pipeline = QueryPipeline(std::move(chain));
pipeline.setNumThreads(std::min<size_t>(pipeline.getNumThreads(), settings.max_threads));
pipeline.setConcurrencyControl(settings.use_concurrency_control);
@ -735,7 +736,11 @@ BlockIO InterpreterInsertQuery::execute()
{
if (settings.parallel_distributed_insert_select)
{
res.pipeline = *table->distributedWrite(query, getContext());
auto distributed = table->distributedWrite(query, getContext());
if (distributed)
res.pipeline = std::move(*distributed);
else
res.pipeline = buildInsertSelectPipeline();
}
else
{