From 59a12645351cb3e702c7e7a4666c416ad57f9c73 Mon Sep 17 00:00:00 2001 From: Andrey Kulaga Date: Thu, 25 Jan 2024 13:44:56 +0000 Subject: [PATCH 1/3] JsonDocument support added --- ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp index 42df38f9ed65..a6fc5bbf89d7 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp @@ -171,6 +171,10 @@ TColumnDataPackInfo GetPackInfo(TType* type) { res.Bytes = 10; break; case NUdf::EDataSlot::Decimal: res.Bytes = 16; break; + case NUdf::EDataSlot::DyNumber: + res.IsString = true; break; + case NUdf::EDataSlot::JsonDocument: + res.IsString = true; break; case NUdf::EDataSlot::String: res.IsString = true; break; case NUdf::EDataSlot::Utf8: From 19977347c4cae5d69f2f562bec2435133565a69b Mon Sep 17 00:00:00 2001 From: Andrey Kulaga Date: Sat, 27 Jan 2024 15:53:20 +0000 Subject: [PATCH 2/3] New wide date types support added --- .../minikql/comp_nodes/mkql_grace_join.cpp | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp index a6fc5bbf89d7..dc346dc88e6e 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp @@ -171,6 +171,14 @@ TColumnDataPackInfo GetPackInfo(TType* type) { res.Bytes = 10; break; case NUdf::EDataSlot::Decimal: res.Bytes = 16; break; + case NUdf::EDataSlot::Date32: + res.Bytes = 4; break; + case NUdf::EDataSlot::Datetime64: + res.Bytes = 8; break; + case NUdf::EDataSlot::Timestamp64: + res.Bytes = 8; break; + case NUdf::EDataSlot::Interval64: + res.Bytes = 8; break; case NUdf::EDataSlot::DyNumber: res.IsString = true; break; case NUdf::EDataSlot::JsonDocument: @@ -269,6 +277,15 @@ void TGraceJoinPacker::Pack() { WriteUnaligned(buffPtr, value.Get()); break; case NUdf::EDataSlot::Interval: WriteUnaligned(buffPtr, value.Get()); break; + case NUdf::EDataSlot::Date32: + WriteUnaligned(buffPtr, value.Get()); break; + case NUdf::EDataSlot::Datetime64: + WriteUnaligned(buffPtr, value.Get()); break; + case NUdf::EDataSlot::Timestamp64: + WriteUnaligned(buffPtr, value.Get()); break; + case NUdf::EDataSlot::Interval64: + WriteUnaligned(buffPtr, value.Get()); break; + case NUdf::EDataSlot::Uuid: { auto str = TuplePtrs[i]->AsStringRef(); @@ -381,6 +398,14 @@ void TGraceJoinPacker::UnPack() { value = NUdf::TUnboxedValuePod(ReadUnaligned(buffPtr)); break; case NUdf::EDataSlot::Interval: value = NUdf::TUnboxedValuePod(ReadUnaligned(buffPtr)); break; + case NUdf::EDataSlot::Date32: + value = NUdf::TUnboxedValuePod(ReadUnaligned(buffPtr)); break; + case NUdf::EDataSlot::Datetime64: + value = NUdf::TUnboxedValuePod(ReadUnaligned(buffPtr)); break; + case NUdf::EDataSlot::Timestamp64: + value = NUdf::TUnboxedValuePod(ReadUnaligned(buffPtr)); break; + case NUdf::EDataSlot::Interval64: + value = NUdf::TUnboxedValuePod(ReadUnaligned(buffPtr)); break; case NUdf::EDataSlot::Uuid: { value = MakeString(NUdf::TStringRef(TupleStrings[offset], TupleStrSizes[offset])); From 9b38b64cbefbb0ceba89b9d69718674b8c52cf53 Mon Sep 17 00:00:00 2001 From: Andrey Kulaga Date: Mon, 29 Jan 2024 16:03:27 +0000 Subject: [PATCH 3/3] Duplicates in switch statement removed --- ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp index dc346dc88e6e..63e09d4a397a 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp @@ -161,8 +161,6 @@ TColumnDataPackInfo GetPackInfo(TType* type) { res.Bytes = sizeof(ui64); break; case NUdf::EDataSlot::Interval: res.Bytes = sizeof(i64); break; - case NUdf::EDataSlot::Uuid: - res.IsString = true; break; case NUdf::EDataSlot::TzDate: res.Bytes = 4; break; case NUdf::EDataSlot::TzDatetime: @@ -179,16 +177,12 @@ TColumnDataPackInfo GetPackInfo(TType* type) { res.Bytes = 8; break; case NUdf::EDataSlot::Interval64: res.Bytes = 8; break; + case NUdf::EDataSlot::Uuid: case NUdf::EDataSlot::DyNumber: - res.IsString = true; break; case NUdf::EDataSlot::JsonDocument: - res.IsString = true; break; case NUdf::EDataSlot::String: - res.IsString = true; break; case NUdf::EDataSlot::Utf8: - res.IsString = true; break; case NUdf::EDataSlot::Yson: - res.IsString = true; break; case NUdf::EDataSlot::Json: res.IsString = true; break; default: