Do not materialize header for merge tables.

This commit is contained in:
Nikolai Kochetov 2020-06-16 11:08:32 +03:00
parent d6e69211b1
commit 66c0ef2610

View File

@ -407,7 +407,6 @@ Block StorageMerge::getQueryHeader(
if (query_info.prewhere_info)
{
query_info.prewhere_info->prewhere_actions->execute(header);
header = materializeBlock(header);
if (query_info.prewhere_info->remove_prewhere_column)
header.erase(query_info.prewhere_info->prewhere_column_name);
}
@ -415,9 +414,9 @@ Block StorageMerge::getQueryHeader(
}
case QueryProcessingStage::WithMergeableState:
case QueryProcessingStage::Complete:
return materializeBlock(InterpreterSelectQuery(
return InterpreterSelectQuery(
query_info.query, context, std::make_shared<OneBlockInputStream>(getSampleBlockForColumns(column_names)),
SelectQueryOptions(processed_stage).analyze()).getSampleBlock());
SelectQueryOptions(processed_stage).analyze()).getSampleBlock();
}
throw Exception("Logical Error: unknown processed stage.", ErrorCodes::LOGICAL_ERROR);
}