diff options
author | hcpp <hcpp@ydb.tech> | 2023-01-11 19:17:08 +0300 |
---|---|---|
committer | hcpp <hcpp@ydb.tech> | 2023-01-11 19:17:08 +0300 |
commit | f0ca03c2270a6be58c0f0a5575eb4c68327b4b50 (patch) | |
tree | 528531565509fa03c6b55228654fe4328acf7af3 | |
parent | aac4f8462008395659ca657daf715ba68b41cedf (diff) | |
download | ydb-f0ca03c2270a6be58c0f0a5575eb4c68327b4b50.tar.gz |
PathGenerator tests has been fixed
-rw-r--r-- | ydb/library/yql/providers/s3/path_generator/ut/yql_parse_partitioning_rules_ut.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/ydb/library/yql/providers/s3/path_generator/ut/yql_parse_partitioning_rules_ut.cpp b/ydb/library/yql/providers/s3/path_generator/ut/yql_parse_partitioning_rules_ut.cpp index 6a9381a542..fa54260065 100644 --- a/ydb/library/yql/providers/s3/path_generator/ut/yql_parse_partitioning_rules_ut.cpp +++ b/ydb/library/yql/providers/s3/path_generator/ut/yql_parse_partitioning_rules_ut.cpp @@ -88,7 +88,7 @@ Y_UNIT_TEST_SUITE(TParseTests) { "projection.city.values" : "MSK,SPB", "storage.location.template" : "/${city}/${device_id}/" } - )", {"city"}), yexception, "Colum named device_id does not exist for template ${city}/${device_id}/"); + )", {"city"}), yexception, "Partitioned by column named device_id does not exist for template ${city}/${device_id}/"); } Y_UNIT_TEST(StartSubstition) { @@ -97,19 +97,30 @@ Y_UNIT_TEST_SUITE(TParseTests) { "projection.enabled" : true, "projection.city.type" : "enum", "projection.city.values" : "MSK,SPB", + "projection.device_id.type" : "enum", + "projection.device_id.values" : "3f75", "storage.location.template" : "/${city}/${device_id}/" } )", {"city", "device_id"}); const auto& result = generator->GetConfig(); UNIT_ASSERT_VALUES_EQUAL(result.Enabled, true); UNIT_ASSERT_VALUES_EQUAL(result.LocationTemplate, "${city}/${device_id}/"); - UNIT_ASSERT_VALUES_EQUAL(result.Rules.size(), 1); - const auto& rule = result.Rules.front(); - UNIT_ASSERT_VALUES_EQUAL(rule.Type, IPathGenerator::EType::ENUM); - UNIT_ASSERT_VALUES_EQUAL(rule.Name, "city"); - UNIT_ASSERT_VALUES_EQUAL(rule.Values.size(), 2); - UNIT_ASSERT_VALUES_EQUAL(rule.Values.front(), "MSK"); - UNIT_ASSERT_VALUES_EQUAL(rule.Values.back(), "SPB"); + UNIT_ASSERT_VALUES_EQUAL(result.Rules.size(), 2); + { + const auto& rule = result.Rules.front(); + UNIT_ASSERT_VALUES_EQUAL(rule.Type, IPathGenerator::EType::ENUM); + UNIT_ASSERT_VALUES_EQUAL(rule.Name, "city"); + UNIT_ASSERT_VALUES_EQUAL(rule.Values.size(), 2); + UNIT_ASSERT_VALUES_EQUAL(rule.Values.front(), "MSK"); + UNIT_ASSERT_VALUES_EQUAL(rule.Values.back(), "SPB"); + } + { + const auto& rule = result.Rules.back(); + UNIT_ASSERT_VALUES_EQUAL(rule.Type, IPathGenerator::EType::ENUM); + UNIT_ASSERT_VALUES_EQUAL(rule.Name, "device_id"); + UNIT_ASSERT_VALUES_EQUAL(rule.Values.size(), 1); + UNIT_ASSERT_VALUES_EQUAL(rule.Values.front(), "3f75"); + } } Y_UNIT_TEST(InvalidValuesType) { |