aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimunkin <imunkin@yandex-team.com>2025-02-24 19:48:19 +0300
committerimunkin <imunkin@yandex-team.com>2025-02-24 20:05:11 +0300
commitb8c84f9c7ab43d974ed40cc6c70be444fee759a4 (patch)
tree2874693f2a9ec0a8fb98989de69d8b5c1a70aa68
parent51e97f891cfbec9801f6a2803dd244d7ebe86b34 (diff)
downloadydb-b8c84f9c7ab43d974ed40cc6c70be444fee759a4.tar.gz
Handle AutoMap flag in TCallableArgsHelper the right way
commit_hash:98f3bddb416cee821c3779e58ffe8a92d61304de
-rw-r--r--yql/essentials/public/udf/udf_type_builder.h32
1 files changed, 24 insertions, 8 deletions
diff --git a/yql/essentials/public/udf/udf_type_builder.h b/yql/essentials/public/udf/udf_type_builder.h
index 818e35b32e..47b455ba26 100644
--- a/yql/essentials/public/udf/udf_type_builder.h
+++ b/yql/essentials/public/udf/udf_type_builder.h
@@ -705,7 +705,7 @@ using IFunctionTypeInfoBuilderImpl = IFunctionTypeInfoBuilder1;
class IFunctionTypeInfoBuilder: public IFunctionTypeInfoBuilderImpl {
public:
IFunctionTypeInfoBuilder();
-
+
IFunctionTypeInfoBuilder& Implementation(
TUniquePtr<IBoxedValue> impl) {
ImplementationImpl(std::move(impl));
@@ -884,13 +884,6 @@ struct TTypeBuilderHelper<TOptional<T>> {
}
};
-template <typename T>
-struct TTypeBuilderHelper<TAutoMap<T>> {
- static TType* Build(const IFunctionTypeInfoBuilder& builder) {
- return TTypeBuilderHelper<T>::Build(builder);
- }
-};
-
template <typename TKey, typename TValue>
struct TTypeBuilderHelper<TDict<TKey, TValue>> {
static TType* Build(const IFunctionTypeInfoBuilder& builder) {
@@ -987,6 +980,29 @@ struct TCallableArgsHelper<TArg, TArgs...> {
}
};
+template <typename TArg, typename... TArgs>
+struct TCallableArgsHelper<TAutoMap<TArg>, TArgs...> {
+ static void Arg(
+ ICallableTypeBuilder& callableBuilder,
+ const IFunctionTypeInfoBuilder& builder)
+ {
+ callableBuilder.Arg(TTypeBuilderHelper<TArg>::Build(builder))
+#if UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 38)
+ // XXX: Unfortunately, ICallableTypeBuilder provides Flags
+ // method only since UDF ABI 2.38. However, AutoMap flag
+ // has been silently ignored by this builder and also by
+ // the TTypeBuilderHelper specialization for AutoMap type.
+ // Hence, the correct AutoMap type processing is wrapped
+ // with this compatibility macro, since the caller of
+ // ICallableTypeBuilder has to explicitly set AutoMap flag
+ // for the particular argument anyway.
+ .Flags(ICallablePayload::TArgumentFlags::AutoMap)
+#endif
+ ;
+ TCallableArgsHelper<TArgs...>::Arg(callableBuilder, builder);
+ }
+};
+
template <typename TReturn, typename... TArgs>
struct TTypeBuilderHelper<TReturn(*)(TArgs...)> {
static TType* Build(const IFunctionTypeInfoBuilder& builder) {