diff options
author | hcpp <hcpp@ydb.tech> | 2023-08-24 21:29:41 +0300 |
---|---|---|
committer | hcpp <hcpp@ydb.tech> | 2023-08-24 22:08:44 +0300 |
commit | b1210bd96e66a5e7c66cc3c602e3062157170222 (patch) | |
tree | 5164b6fc841154c723b2ac40cdc081519e354b59 | |
parent | 24fce6d1ca9debced3e88aec3a404aa233a6c1c9 (diff) | |
download | ydb-b1210bd96e66a5e7c66cc3c602e3062157170222.tar.gz |
check activation fix
-rw-r--r-- | ydb/core/fq/libs/compute/common/config.h | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/ydb/core/fq/libs/compute/common/config.h b/ydb/core/fq/libs/compute/common/config.h index b0616b1bff0..c197e98c71f 100644 --- a/ydb/core/fq/libs/compute/common/config.h +++ b/ydb/core/fq/libs/compute/common/config.h @@ -32,21 +32,22 @@ public: NFq::NConfig::EComputeType GetComputeType(const FederatedQuery::QueryContent::QueryType queryType, const TString& scope) const { for (const auto& mapping : ComputeConfig.GetComputeMapping()) { - if (mapping.GetQueryType() == queryType) { - if (mapping.HasActivation()) { - const auto& activation = mapping.GetActivation(); - const auto& includeScopes = activation.GetIncludeScopes(); - const auto& excludeScopes = activation.GetExcludeScopes(); - auto isActivatedCase1 = - activation.GetPercentage() == 0 && - Find(includeScopes, scope) == includeScopes.end(); - auto isActivatedCase2 = - activation.GetPercentage() == 100 && - Find(excludeScopes, scope) != excludeScopes.end(); - if (isActivatedCase1 || isActivatedCase2) { - return mapping.GetCompute(); - } - } + if (mapping.GetQueryType() != queryType) { + continue; + } + if (!mapping.HasActivation()) { + return mapping.GetCompute(); + } + const auto& activation = mapping.GetActivation(); + const auto& includeScopes = activation.GetIncludeScopes(); + const auto& excludeScopes = activation.GetExcludeScopes(); + auto isActivatedCase1 = + activation.GetPercentage() == 0 && + Find(includeScopes, scope) == includeScopes.end(); + auto isActivatedCase2 = + activation.GetPercentage() == 100 && + Find(excludeScopes, scope) != excludeScopes.end(); + if (isActivatedCase1 || isActivatedCase2) { return mapping.GetCompute(); } } |