aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraneporada <aneporada@ydb.tech>2023-03-10 20:45:33 +0300
committeraneporada <aneporada@ydb.tech>2023-03-10 20:45:33 +0300
commitbda403b05975ff43ed1e4b3e5e287b3b33566fcf (patch)
tree884a95bd810809e2805c04b097d5595730d833ba
parent68707ff3df03cb20da93f18b8e608a699aa6009f (diff)
downloadydb-bda403b05975ff43ed1e4b3e5e287b3b33566fcf.tar.gz
Add WideFetch methon to TUnboxedValue, bump ABI version
-rw-r--r--ydb/library/yql/minikql/computation/mkql_computation_node_impl.h7
-rw-r--r--ydb/library/yql/public/udf/udf_value.h80
-rw-r--r--ydb/library/yql/public/udf/udf_value_inl.h14
-rw-r--r--ydb/library/yql/public/udf/udf_version.h2
4 files changed, 100 insertions, 3 deletions
diff --git a/ydb/library/yql/minikql/computation/mkql_computation_node_impl.h b/ydb/library/yql/minikql/computation/mkql_computation_node_impl.h
index 991978740db..5267127152f 100644
--- a/ydb/library/yql/minikql/computation/mkql_computation_node_impl.h
+++ b/ydb/library/yql/minikql/computation/mkql_computation_node_impl.h
@@ -1013,6 +1013,13 @@ private:
ThrowNotSupported(__func__);
}
+ NUdf::EFetchStatus WideFetch(NUdf::TUnboxedValue* result, ui32 width) override {
+ Y_UNUSED(result);
+ Y_UNUSED(width);
+ ThrowNotSupported(__func__);
+ return NUdf::EFetchStatus::Finish;
+ }
+
public:
TString DebugString() const {
return TypeName<TDerived>();
diff --git a/ydb/library/yql/public/udf/udf_value.h b/ydb/library/yql/public/udf/udf_value.h
index 41649061c90..09f98b390c0 100644
--- a/ydb/library/yql/public/udf/udf_value.h
+++ b/ydb/library/yql/public/udf/udf_value.h
@@ -173,7 +173,17 @@ private:
};
#endif
-#if UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 19)
+#if UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 30)
+class IBoxedValue6 : public IBoxedValue5 {
+friend struct TBoxedValueAccessor;
+private:
+ virtual EFetchStatus WideFetch(TUnboxedValue* result, ui32 width) = 0;
+};
+#endif
+
+#if UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 30)
+class IBoxedValue : public IBoxedValue6 {};
+#elif UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 19)
class IBoxedValue : public IBoxedValue5 {};
#elif UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 12)
class IBoxedValue : public IBoxedValue4 {};
@@ -194,7 +204,53 @@ UDF_ASSERT_TYPE_SIZE(IBoxedValuePtr, 8);
///////////////////////////////////////////////////////////////////////////////
struct TBoxedValueAccessor
{
-#if UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 19)
+#if UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 30)
+
+#define METHOD_MAP(xx) \
+ xx(HasFastListLength) \
+ xx(GetListLength) \
+ xx(GetEstimatedListLength) \
+ xx(GetListIterator) \
+ xx(GetListRepresentation) \
+ xx(ReverseListImpl) \
+ xx(SkipListImpl) \
+ xx(TakeListImpl) \
+ xx(ToIndexDictImpl) \
+ xx(GetDictLength) \
+ xx(GetDictIterator) \
+ xx(GetKeysIterator) \
+ xx(GetPayloadsIterator) \
+ xx(Contains) \
+ xx(Lookup) \
+ xx(GetElement) \
+ xx(GetElements) \
+ xx(Run) \
+ xx(GetResourceTag) \
+ xx(GetResource) \
+ xx(HasListItems) \
+ xx(HasDictItems) \
+ xx(GetVariantIndex) \
+ xx(GetVariantItem) \
+ xx(Fetch) \
+ xx(Skip) \
+ xx(Next) \
+ xx(NextPair) \
+ xx(Apply) \
+ xx(GetTraverseCount) \
+ xx(GetTraverseItem) \
+ xx(Save) \
+ xx(Load) \
+ xx(Push) \
+ xx(IsSortedDict) \
+ xx(Unused1) \
+ xx(Unused2) \
+ xx(Unused3) \
+ xx(Unused4) \
+ xx(Unused5) \
+ xx(Unused6) \
+ xx(WideFetch)
+
+#elif UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 19)
#define METHOD_MAP(xx) \
xx(HasFastListLength) \
@@ -477,6 +533,10 @@ struct TBoxedValueAccessor
#if UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 12)
static inline bool IsSortedDict(IBoxedValue& value);
#endif
+
+#if UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 30)
+ static inline EFetchStatus WideFetch(IBoxedValue& value, TUnboxedValue* result, ui32 width);
+#endif
};
#define MAP_HANDLER(xx) template<> inline uintptr_t TBoxedValueAccessor::GetMethodPtr<TBoxedValueAccessor::EMethod::xx>() { return GetMethodPtr(&IBoxedValue::xx); }
@@ -561,6 +621,10 @@ private:
void Unused5() override;
void Unused6() override;
#endif
+
+#if UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 30)
+ EFetchStatus WideFetch(TUnboxedValue* result, ui32 width) override;
+#endif
};
class TBoxedValueLink: public TBoxedValueBase
@@ -729,6 +793,10 @@ public:
inline bool IsSortedDict() const;
#endif
+#if UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 30)
+ inline EFetchStatus WideFetch(TUnboxedValue *result, ui32 width) const;
+#endif
+
inline bool TryMakeVariant(ui32 index);
inline void SetTimezoneId(ui16 id);
@@ -1129,6 +1197,14 @@ inline void TBoxedValueBase::Unused6() {
}
#endif
+#if UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 30)
+inline EFetchStatus TBoxedValueBase::WideFetch(TUnboxedValue *result, ui32 width) {
+ Y_UNUSED(result);
+ Y_UNUSED(width);
+ Y_FAIL("Not implemented");
+}
+#endif
+
inline void TUnboxedValuePod::Dump(IOutputStream& out) const {
switch (Raw.GetMarkers()) {
case EMarkers::Empty:
diff --git a/ydb/library/yql/public/udf/udf_value_inl.h b/ydb/library/yql/public/udf/udf_value_inl.h
index 2d3e1fea190..7f83583e43a 100644
--- a/ydb/library/yql/public/udf/udf_value_inl.h
+++ b/ydb/library/yql/public/udf/udf_value_inl.h
@@ -276,6 +276,13 @@ inline bool TBoxedValueAccessor::IsSortedDict(IBoxedValue& value) {
}
#endif
+#if UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 30)
+inline EFetchStatus TBoxedValueAccessor::WideFetch(IBoxedValue& value, TUnboxedValue* result, ui32 width) {
+ Y_VERIFY_DEBUG(value.IsCompatibleTo(MakeAbiCompatibilityVersion(2, 30)));
+ return value.WideFetch(result, width);
+}
+#endif
+
//////////////////////////////////////////////////////////////////////////////
// TUnboxedValue
//////////////////////////////////////////////////////////////////////////////
@@ -601,6 +608,13 @@ inline bool TUnboxedValuePod::IsSortedDict() const {
}
#endif
+#if UDF_ABI_COMPATIBILITY_VERSION_CURRENT >= UDF_ABI_COMPATIBILITY_VERSION(2, 30)
+inline EFetchStatus TUnboxedValuePod::WideFetch(TUnboxedValue* result, ui32 width) const {
+ UDF_VERIFY(IsBoxed(), "Value is not a wide stream");
+ return TBoxedValueAccessor::WideFetch(*Raw.Boxed.Value, result, width);
+}
+#endif
+
Y_FORCE_INLINE void TUnboxedValuePod::Ref() const noexcept
{
switch (Raw.GetMarkers()) {
diff --git a/ydb/library/yql/public/udf/udf_version.h b/ydb/library/yql/public/udf/udf_version.h
index 52cb0f27b61..60a7ea03850 100644
--- a/ydb/library/yql/public/udf/udf_version.h
+++ b/ydb/library/yql/public/udf/udf_version.h
@@ -7,7 +7,7 @@ namespace NYql {
namespace NUdf {
#define CURRENT_UDF_ABI_VERSION_MAJOR 2
-#define CURRENT_UDF_ABI_VERSION_MINOR 29
+#define CURRENT_UDF_ABI_VERSION_MINOR 30
#define CURRENT_UDF_ABI_VERSION_PATCH 0
#ifdef USE_CURRENT_UDF_ABI_VERSION