aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ydb/core/fq/libs/compute/common/config.h2
-rw-r--r--ydb/core/fq/libs/compute/common/ut/config_ut.cpp32
2 files changed, 32 insertions, 2 deletions
diff --git a/ydb/core/fq/libs/compute/common/config.h b/ydb/core/fq/libs/compute/common/config.h
index 5beb8bf509..938d1dcba8 100644
--- a/ydb/core/fq/libs/compute/common/config.h
+++ b/ydb/core/fq/libs/compute/common/config.h
@@ -46,7 +46,7 @@ public:
Find(includeScopes, scope) != includeScopes.end();
auto isActivatedCase2 =
activation.GetPercentage() == 100 &&
- Find(excludeScopes, scope) != excludeScopes.end();
+ Find(excludeScopes, scope) == excludeScopes.end();
if (isActivatedCase1 || isActivatedCase2) {
return mapping.GetCompute();
}
diff --git a/ydb/core/fq/libs/compute/common/ut/config_ut.cpp b/ydb/core/fq/libs/compute/common/ut/config_ut.cpp
index ea87dcfbe3..9dbc961103 100644
--- a/ydb/core/fq/libs/compute/common/ut/config_ut.cpp
+++ b/ydb/core/fq/libs/compute/common/ut/config_ut.cpp
@@ -6,7 +6,7 @@
#include <google/protobuf/text_format.h>
Y_UNIT_TEST_SUITE(Config) {
- Y_UNIT_TEST(Test1) {
+ Y_UNIT_TEST(IncludeScope) {
NFq::NConfig::TComputeConfig proto;
UNIT_ASSERT(google::protobuf::TextFormat::ParseFromString(R"(
DefaultCompute: IN_PLACE
@@ -34,4 +34,34 @@ Y_UNIT_TEST_SUITE(Config) {
UNIT_ASSERT(config.YdbComputeControlPlaneEnabled("oss://test1"));
UNIT_ASSERT(!config.YdbComputeControlPlaneEnabled("oss://test2"));
}
+
+ Y_UNIT_TEST(ExcludeScope) {
+ NFq::NConfig::TComputeConfig proto;
+ UNIT_ASSERT(google::protobuf::TextFormat::ParseFromString(R"(
+ DefaultCompute: IN_PLACE
+ ComputeMapping {
+ QueryType: ANALYTICS
+ Compute: YDB
+ Activation {
+ Percentage: 100
+ ExcludeScopes: "oss://test1"
+ }
+ }
+ Ydb {
+ Enable: true
+ ControlPlane {
+ Enable: true
+ Cms {
+ }
+ }
+ PinTenantName: "/root/cp"
+ SynchronizationService {
+ Enable: True
+ }
+ }
+ )", &proto));
+ NFq::TComputeConfig config(proto);
+ UNIT_ASSERT(!config.YdbComputeControlPlaneEnabled("oss://test1"));
+ UNIT_ASSERT(config.YdbComputeControlPlaneEnabled("oss://test2"));
+ }
}