Skip to content

JsonDocument support added YQL-17658 #1306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -171,12 +169,20 @@ 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::Uuid:
case NUdf::EDataSlot::DyNumber:
case NUdf::EDataSlot::JsonDocument:
case NUdf::EDataSlot::String:
res.IsString = true; break;
case NUdf::EDataSlot::Utf8:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо убрать default из этого switch, что бы компилятор ловил появление новых типов

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Там как раз в момент появления новых типов в default срабатывает проверка. Типы там динамически передаются в виде списка типов колонок.

res.IsString = true; break;
case NUdf::EDataSlot::Yson:
res.IsString = true; break;
case NUdf::EDataSlot::Json:
res.IsString = true; break;
default:
Expand Down Expand Up @@ -265,6 +271,15 @@ void TGraceJoinPacker::Pack() {
WriteUnaligned<ui64>(buffPtr, value.Get<ui64>()); break;
case NUdf::EDataSlot::Interval:
WriteUnaligned<i64>(buffPtr, value.Get<i64>()); break;
case NUdf::EDataSlot::Date32:
WriteUnaligned<i64>(buffPtr, value.Get<i32>()); break;
case NUdf::EDataSlot::Datetime64:
WriteUnaligned<i64>(buffPtr, value.Get<i64>()); break;
case NUdf::EDataSlot::Timestamp64:
WriteUnaligned<i64>(buffPtr, value.Get<i64>()); break;
case NUdf::EDataSlot::Interval64:
WriteUnaligned<i64>(buffPtr, value.Get<i64>()); break;

case NUdf::EDataSlot::Uuid:
{
auto str = TuplePtrs[i]->AsStringRef();
Expand Down Expand Up @@ -377,6 +392,14 @@ void TGraceJoinPacker::UnPack() {
value = NUdf::TUnboxedValuePod(ReadUnaligned<ui64>(buffPtr)); break;
case NUdf::EDataSlot::Interval:
value = NUdf::TUnboxedValuePod(ReadUnaligned<i64>(buffPtr)); break;
case NUdf::EDataSlot::Date32:
value = NUdf::TUnboxedValuePod(ReadUnaligned<i32>(buffPtr)); break;
case NUdf::EDataSlot::Datetime64:
value = NUdf::TUnboxedValuePod(ReadUnaligned<i64>(buffPtr)); break;
case NUdf::EDataSlot::Timestamp64:
value = NUdf::TUnboxedValuePod(ReadUnaligned<i64>(buffPtr)); break;
case NUdf::EDataSlot::Interval64:
value = NUdf::TUnboxedValuePod(ReadUnaligned<i64>(buffPtr)); break;
case NUdf::EDataSlot::Uuid:
{
value = MakeString(NUdf::TStringRef(TupleStrings[offset], TupleStrSizes[offset]));
Expand Down