Add QueryStatus to BuildQueryPipelineSettings and use it

This commit is contained in:
Raúl Marín 2021-12-02 18:18:52 +01:00
parent 9fe648ef8e
commit edf4095139
4 changed files with 8 additions and 9 deletions

View File

@ -6,16 +6,12 @@
namespace DB
{
BuildQueryPipelineSettings BuildQueryPipelineSettings::fromSettings(const Settings & from)
BuildQueryPipelineSettings BuildQueryPipelineSettings::fromContext(ContextPtr from)
{
BuildQueryPipelineSettings settings;
settings.actions_settings = ExpressionActionsSettings::fromSettings(from, CompileExpressions::yes);
settings.actions_settings = ExpressionActionsSettings::fromSettings(from->getSettingsRef(), CompileExpressions::yes);
settings.process_list_element = from->getProcessListElement();
return settings;
}
BuildQueryPipelineSettings BuildQueryPipelineSettings::fromContext(ContextPtr from)
{
return fromSettings(from->getSettingsRef());
}
}

View File

@ -8,14 +8,14 @@ namespace DB
{
struct Settings;
class QueryStatus;
struct BuildQueryPipelineSettings
{
ExpressionActionsSettings actions_settings;
QueryStatus * process_list_element = nullptr;
const ExpressionActionsSettings & getActionsSettings() const { return actions_settings; }
static BuildQueryPipelineSettings fromSettings(const Settings & from);
static BuildQueryPipelineSettings fromContext(ContextPtr from);
};

View File

@ -180,6 +180,8 @@ QueryPipelineBuilderPtr QueryPlan::buildQueryPipeline(
for (auto & context : interpreter_context)
last_pipeline->addInterpreterContext(std::move(context));
last_pipeline->setProcessListElement(build_pipeline_settings.process_list_element);
return last_pipeline;
}

View File

@ -560,6 +560,7 @@ QueryPipeline QueryPipelineBuilder::getPipeline(QueryPipelineBuilder builder)
{
QueryPipeline res(std::move(builder.pipe));
res.setNumThreads(builder.getNumThreads());
res.setProcessListElement(builder.process_list_element);
return res;
}