This commit is contained in:
kssenii 2021-11-11 16:10:07 +03:00
parent 18b9a8f7fd
commit d8ef39461f

View File

@ -395,13 +395,8 @@ Pipe StorageMerge::createSources(
bool concat_streams)
{
const auto & [database_name, storage, struct_lock, table_name] = storage_with_lock;
/// Original query could contain JOIN but we need only the first joined table and its columns.
auto & modified_select = modified_query_info.query->as<ASTSelectQuery &>();
TreeRewriterResult new_analyzer_res = *modified_query_info.syntax_analyzer_result;
removeJoin(modified_select, new_analyzer_res, modified_context);
modified_query_info.syntax_analyzer_result = std::make_shared<TreeRewriterResult>(std::move(new_analyzer_res));
Pipe pipe;
if (!storage)