diff options
author | whatsername <whatsername@yandex-team.com> | 2024-04-27 22:18:13 +0300 |
---|---|---|
committer | whatsername <whatsername@yandex-team.com> | 2024-04-27 22:27:53 +0300 |
commit | 0f9874a47090250cf263e617e4c6fcc410eb6ffd (patch) | |
tree | 9a4ca8fb0b87d4a1949a6a19aaa503fe1f36aca0 /yt | |
parent | c2baaafea37b31eeaf297770daf39780acf49a2b (diff) | |
download | ydb-0f9874a47090250cf263e617e4c6fcc410eb6ffd.tar.gz |
YT-21169: More tests for static sorted tables & any
7e1069fdd9ab451fffe23156894576438876a865
Diffstat (limited to 'yt')
-rw-r--r-- | yt/yt/client/table_client/composite_compare.cpp | 3 | ||||
-rw-r--r-- | yt/yt/client/table_client/unversioned_row.cpp | 6 | ||||
-rw-r--r-- | yt/yt/client/table_client/unversioned_value.cpp | 1 | ||||
-rw-r--r-- | yt/yt/client/unittests/row_ut.cpp | 1 |
4 files changed, 7 insertions, 4 deletions
diff --git a/yt/yt/client/table_client/composite_compare.cpp b/yt/yt/client/table_client/composite_compare.cpp index 0031bef401..24d2c755ec 100644 --- a/yt/yt/client/table_client/composite_compare.cpp +++ b/yt/yt/client/table_client/composite_compare.cpp @@ -1,6 +1,7 @@ #include "composite_compare.h" #include <yt/yt/client/table_client/row_base.h> + #include <yt/yt/core/yson/pull_parser.h> #include <yt/yt/core/yson/token_writer.h> @@ -30,7 +31,7 @@ namespace { // 3. Tuple // 4. Variant // -// When we compare composite or any values we assume that they are well-formed yson representations of same type supporting comparison. +// When we compare composite or any values we assume that they are well-formed YSON representations of same type supporting comparison. // And we compare them in following manner: // 1. We scan two values simultaneously and look at their yson tokens and find first mismatching token. // 2. If one of the token is EndList (this only can happen if we parsing values of list type diff --git a/yt/yt/client/table_client/unversioned_row.cpp b/yt/yt/client/table_client/unversioned_row.cpp index cbf238516c..63e125969c 100644 --- a/yt/yt/client/table_client/unversioned_row.cpp +++ b/yt/yt/client/table_client/unversioned_row.cpp @@ -707,7 +707,7 @@ void ValidateAnyValue(TStringBuf yson) ParseYsonStringBuffer(yson, EYsonType::Node, &validator); } -bool ValidateSortedAnyValue(TStringBuf yson) +bool CheckSortedAnyValue(TStringBuf yson) { TYsonAnyValidator validator; ParseYsonStringBuffer(yson, EYsonType::Node, &validator); @@ -1071,11 +1071,11 @@ void ValidateValueType( } if (IsAnyOrComposite(value.Type)) { if (columnSchema.SortOrder()) { - bool canBeSorted = ValidateSortedAnyValue(value.AsStringBuf()); + bool canBeSorted = CheckSortedAnyValue(value.AsStringBuf()); if (!canBeSorted) { THROW_ERROR_EXCEPTION( NTableClient::EErrorCode::SchemaViolation, - "Cannot write value of type %Qlv, which contains a YSON map, into type any sorted column", + "Cannot write value of type %Qlv, which contains a YSON map, into sorted column of type any", value.Type); } } else if (validateAnyIsValidYson) { diff --git a/yt/yt/client/table_client/unversioned_value.cpp b/yt/yt/client/table_client/unversioned_value.cpp index 9f602ed918..33b0451463 100644 --- a/yt/yt/client/table_client/unversioned_value.cpp +++ b/yt/yt/client/table_client/unversioned_value.cpp @@ -48,6 +48,7 @@ TFingerprint GetFarmFingerprint(const TUnversionedValue& value) return NYT::FarmFingerprint(0); case EValueType::Composite: + case EValueType::Any: return CompositeFarmHash(NYson::TYsonStringBuf(value.AsStringBuf())); default: diff --git a/yt/yt/client/unittests/row_ut.cpp b/yt/yt/client/unittests/row_ut.cpp index 91a2e67ab4..00eba96742 100644 --- a/yt/yt/client/unittests/row_ut.cpp +++ b/yt/yt/client/unittests/row_ut.cpp @@ -4,6 +4,7 @@ #include <yt/yt/client/table_client/versioned_row.h> #include <yt/yt/core/test_framework/framework.h> + #include <yt/yt/core/misc/protobuf_helpers.h> #include <limits> |