mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-24 10:40:49 +00:00
Fix DISTINCT for Distributed and optimize_skip_unused_shards
In case of optimize_skip_unused_shards the getQueryProcessingStage() can return QueryProcessingStage::WithMergeableState because the whole cluster has multiple nodes, but optimize_skip_unused_shards can trim it to 1 and in this case we need final merge that won't be done with QueryProcessingStage::WithMergeableState only with QueryProcessingStage::Complete.
This commit is contained in:
parent
0e925ff7ad
commit
b8614de64a
@ -369,9 +369,9 @@ static QueryProcessingStage::Enum getQueryProcessingStageImpl(const Context & co
|
||||
: QueryProcessingStage::WithMergeableState;
|
||||
}
|
||||
|
||||
QueryProcessingStage::Enum StorageDistributed::getQueryProcessingStage(const Context & context, const ASTPtr &) const
|
||||
QueryProcessingStage::Enum StorageDistributed::getQueryProcessingStage(const Context & context, const ASTPtr & query_ptr) const
|
||||
{
|
||||
auto cluster = getCluster();
|
||||
auto cluster = getOptimizedCluster(context, query_ptr);
|
||||
return getQueryProcessingStageImpl(context, cluster);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user