Merge pull request #12040 from azat/dist-fixes

Tiny fixes for distributed queries
This commit is contained in:
alexey-milovidov 2020-07-02 17:02:56 +03:00 committed by GitHub
commit 82061da77c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ Context removeUserRestrictionsFromSettings(const Context & context, const Settin
new_settings.max_concurrent_queries_for_user.changed = false; new_settings.max_concurrent_queries_for_user.changed = false;
new_settings.max_memory_usage_for_user.changed = false; new_settings.max_memory_usage_for_user.changed = false;
if (settings.force_optimize_skip_unused_shards_nesting) if (settings.force_optimize_skip_unused_shards_nesting && settings.force_optimize_skip_unused_shards)
{ {
if (new_settings.force_optimize_skip_unused_shards_nesting == 1) if (new_settings.force_optimize_skip_unused_shards_nesting == 1)
{ {
@ -48,7 +48,7 @@ Context removeUserRestrictionsFromSettings(const Context & context, const Settin
} }
} }
if (settings.optimize_skip_unused_shards_nesting) if (settings.optimize_skip_unused_shards_nesting && settings.optimize_skip_unused_shards)
{ {
if (new_settings.optimize_skip_unused_shards_nesting == 1) if (new_settings.optimize_skip_unused_shards_nesting == 1)
{ {

View File

@ -722,7 +722,7 @@ ClusterPtr StorageDistributed::getOptimizedCluster(const Context & context, cons
std::stringstream exception_message; std::stringstream exception_message;
if (!has_sharding_key) if (!has_sharding_key)
exception_message << "No sharding key"; exception_message << "No sharding key";
else if (sharding_key_is_deterministic) else if (!sharding_key_is_deterministic)
exception_message << "Sharding key is not deterministic"; exception_message << "Sharding key is not deterministic";
else else
exception_message << "Sharding key " << sharding_key_column_name << " is not used"; exception_message << "Sharding key " << sharding_key_column_name << " is not used";