Fix for subqueries with FINAL

This commit is contained in:
Igor Nikonov 2024-08-15 11:11:49 +00:00
parent 1a8f45464c
commit a3978b24d0
3 changed files with 6 additions and 0 deletions

View File

@ -52,7 +52,13 @@ std::stack<const QueryNode *> getSupportingParallelReplicasQuery(const IQueryTre
const auto & storage = table_node.getStorage();
/// Here we check StorageDummy as well, to support a query tree with replaced storages.
if (std::dynamic_pointer_cast<MergeTreeData>(storage) || typeid_cast<const StorageDummy *>(storage.get()))
{
/// parallel replicas is not supported with FINAL
if (table_node.getTableExpressionModifiers()->hasFinal())
return {};
return res;
}
return {};
}