diff options
author | vvvv <vvvv@ydb.tech> | 2023-11-13 21:07:04 +0300 |
---|---|---|
committer | vvvv <vvvv@ydb.tech> | 2023-11-13 21:55:56 +0300 |
commit | 3f1524a0889a197a7cf042cb946dc566f38a2ac2 (patch) | |
tree | e82a4594e6283f4438b63fa1874b4c7fa194eba1 | |
parent | bc095290a1691fd5c5f7c3b631220bce7515ea3a (diff) | |
download | ydb-3f1524a0889a197a7cf042cb946dc566f38a2ac2.tar.gz |
Helpers for Void & Set
-rw-r--r-- | ydb/library/yql/public/udf/udf_type_builder.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ydb/library/yql/public/udf/udf_type_builder.h b/ydb/library/yql/public/udf/udf_type_builder.h index 3b8c0f7fe2..8d7d5b4d4c 100644 --- a/ydb/library/yql/public/udf/udf_type_builder.h +++ b/ydb/library/yql/public/udf/udf_type_builder.h @@ -43,6 +43,11 @@ struct TDict { using ValueType = TValue; }; +template <typename TKey> +struct TSetType { + using KeyType = TKey; +}; + template <typename... TArgs> struct TTuple; @@ -67,6 +72,8 @@ struct TBlockType { using ItemType = T; }; template <typename T> struct TScalarType { using ItemType = T; }; +struct TVoid {}; + ////////////////////////////////////////////////////////////////////////////// // ITypeBuilder ////////////////////////////////////////////////////////////////////////////// @@ -874,6 +881,23 @@ struct TTypeBuilderHelper<TDict<TKey, TValue>> { } }; +template <typename TKey> +struct TTypeBuilderHelper<TSetType<TKey>> { + static TType* Build(const IFunctionTypeInfoBuilder& builder) { + return builder.Dict()-> + Key(TTypeBuilderHelper<TKey>::Build(builder)) + .Value(builder.Void()) + .Build(); + } +}; + +template <> +struct TTypeBuilderHelper<TVoid> { + static TType* Build(const IFunctionTypeInfoBuilder& builder) { + return builder.Void(); + } +}; + template <typename T> struct TTypeBuilderHelper<TStream<T>> { static TType* Build(const IFunctionTypeInfoBuilder& builder) { |