Fix actions for distributed.

This commit is contained in:
Nikolai Kochetov 2019-10-03 18:47:42 +03:00
parent e5c1df010f
commit 76d1412953
2 changed files with 6 additions and 6 deletions

View File

@ -458,10 +458,13 @@ Block InterpreterSelectQuery::getSampleBlockImpl()
optimize_prewhere(*merge_tree_data);
}
if (storage && !options.only_analyze)
from_stage = storage->getQueryProcessingStage(context);
analysis_result = analyzeExpressions(
getSelectQuery(),
*query_analyzer,
QueryProcessingStage::Enum::FetchColumns,
from_stage,
options.to_stage,
context,
storage,
@ -933,11 +936,6 @@ void InterpreterSelectQuery::executeImpl(TPipeline & pipeline, const BlockInputS
const Settings & settings = context.getSettingsRef();
auto & expressions = analysis_result;
QueryProcessingStage::Enum from_stage = QueryProcessingStage::FetchColumns;
if (storage && !options.only_analyze)
from_stage = storage->getQueryProcessingStage(context);
SortingInfoPtr sorting_info;
if (settings.optimize_read_in_order && storage && query.orderBy() && !query_analyzer->hasAggregation() && !query.final() && !query.join())
{

View File

@ -264,6 +264,8 @@ private:
AnalysisResult analysis_result;
FilterInfoPtr filter_info;
QueryProcessingStage::Enum from_stage = QueryProcessingStage::FetchColumns;
/// How many streams we ask for storage to produce, and in how many threads we will do further processing.
size_t max_streams = 1;