diff options
author | hcpp <hcpp@ydb.tech> | 2023-08-27 17:25:15 +0300 |
---|---|---|
committer | hcpp <hcpp@ydb.tech> | 2023-08-27 17:38:22 +0300 |
commit | 57be712e6b3bf6c7a5005f003f69d9f527d5cfc5 (patch) | |
tree | 556746f6660a9ebc9d17e3eac2bc961fb4fc3daa | |
parent | 37029766cb60f4caef6d62d2564063cc14636727 (diff) | |
download | ydb-57be712e6b3bf6c7a5005f003f69d9f527d5cfc5.tar.gz |
exclude folder fix
-rw-r--r-- | ydb/core/fq/libs/compute/common/config.h | 2 | ||||
-rw-r--r-- | ydb/core/fq/libs/compute/common/ut/config_ut.cpp | 32 |
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")); + } } |