mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Fix ARRAY JOIN optimisation when reading from MV.
This commit is contained in:
parent
5f7aeddfe5
commit
df02573c92
@ -1114,10 +1114,6 @@ ExpressionActionsPtr ExpressionActions::splitActionsBeforeArrayJoin(const NameSe
|
||||
input_columns = split_actions->getSampleBlock().getNamesAndTypesList();
|
||||
input_columns.insert(input_columns.end(), inputs_from_array_join.begin(), inputs_from_array_join.end());
|
||||
|
||||
/// Remove not needed columns.
|
||||
if (!actions.empty())
|
||||
prependProjectInput();
|
||||
|
||||
return split_actions;
|
||||
}
|
||||
|
||||
|
@ -32,8 +32,13 @@ Pipe StorageValues::read(
|
||||
{
|
||||
metadata_snapshot->check(column_names, getVirtuals(), getStorageID());
|
||||
|
||||
Chunk chunk(res_block.getColumns(), res_block.rows());
|
||||
return Pipe(std::make_shared<SourceFromSingleChunk>(res_block.cloneEmpty(), std::move(chunk)));
|
||||
/// Get only required columns.
|
||||
Block block;
|
||||
for (const auto & name : column_names)
|
||||
block.insert(res_block.getByName(name));
|
||||
|
||||
Chunk chunk(block.getColumns(), block.rows());
|
||||
return Pipe(std::make_shared<SourceFromSingleChunk>(block.cloneEmpty(), std::move(chunk)));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user