Update MergeTreeRangeReader

This commit is contained in:
Nikolai Kochetov 2021-01-29 19:12:53 +03:00
parent 4929fe2063
commit afdc9635cb
2 changed files with 7 additions and 1 deletions

View File

@ -1579,6 +1579,12 @@ void InterpreterSelectQuery::executeFetchColumns(QueryProcessingStage::Enum proc
std::make_shared<ExpressionActions>(expressions.filter_info->actions_dag), std::make_shared<ExpressionActions>(expressions.filter_info->actions_dag),
expressions.filter_info->column_name); expressions.filter_info->column_name);
if (alias_actions)
{
query_info.prewhere_info_list->back().alias_actions = std::make_shared<ExpressionActions>(alias_actions);
alias_actions = nullptr;
}
auto & new_filter_info = query_info.prewhere_info_list->front(); auto & new_filter_info = query_info.prewhere_info_list->front();
new_filter_info.remove_prewhere_column = expressions.filter_info->do_remove_column; new_filter_info.remove_prewhere_column = expressions.filter_info->do_remove_column;

View File

@ -860,7 +860,7 @@ Columns MergeTreeRangeReader::continueReadingChain(ReadResult & result, size_t &
void MergeTreeRangeReader::executePrewhereActionsAndFilterColumns(ReadResult & result) void MergeTreeRangeReader::executePrewhereActionsAndFilterColumns(ReadResult & result)
{ {
if (prewhere_info_list->empty()) if (!prewhere_info_list || prewhere_info_list->empty())
return; return;
const auto & header = merge_tree_reader->getColumns(); const auto & header = merge_tree_reader->getColumns();