Skip to content

Commit

Permalink
Merge 57dcd68 into 680b542
Browse files Browse the repository at this point in the history
  • Loading branch information
avevad authored Sep 16, 2024
2 parents 680b542 + 57dcd68 commit 0b43a07
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions ydb/library/yql/minikql/computation/mkql_value_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ NUdf::TUnboxedValue TDefaultValueBuilder::SubString(NUdf::TUnboxedValuePod value
NUdf::TUnboxedValue TDefaultValueBuilder::NewList(NUdf::TUnboxedValue* items, ui64 count) const {
if (items == nullptr || count == 0) {
return HolderFactory_.GetEmptyContainerLazy();
}

NUdf::TUnboxedValue* inplace = nullptr;
auto array = HolderFactory_.CreateDirectArrayHolder(count, inplace);
std::copy_n(std::make_move_iterator(items), count, inplace);
TUnboxedValueVector list;
for (ui64 i = 0; i < count; ++i) {
list.emplace_back(std::move(*items++));
}

return array;
return HolderFactory_.VectorAsVectorHolder(std::move(list));
}

NUdf::TUnboxedValue TDefaultValueBuilder::ReverseList(const NUdf::TUnboxedValuePod& list) const
Expand Down
12 changes: 6 additions & 6 deletions ydb/library/yql/minikql/jsonpath/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ ui32 TValue::GetSize() const {
return value->GetDictLength();
}
} else {
Y_ABORT("Unexpected variant case in GetString");
Y_ABORT("Unexpected variant case in GetSize");
}
}

Expand All @@ -287,9 +287,9 @@ TValue TValue::GetElement(ui32 index) const {
if (const auto* value = std::get_if<TContainerCursor>(&Value)) {
return TValue(value->GetElement(index));
} else if (const auto* value = std::get_if<TUnboxedValue>(&Value)) {
return TValue(value->GetElement(index));
return TValue(value->Lookup(TUnboxedValuePod(index)));
} else {
Y_ABORT("Unexpected variant case in GetString");
Y_ABORT("Unexpected variant case in GetElement");
}
}

Expand All @@ -304,7 +304,7 @@ TArrayIterator TValue::GetArrayIterator() const {
}
return TArrayIterator(value->GetListIterator());
} else {
Y_ABORT("Unexpected variant case in GetString");
Y_ABORT("Unexpected variant case in GetArrayIterator");
}
}

Expand Down Expand Up @@ -332,7 +332,7 @@ TMaybe<TValue> TValue::Lookup(const TStringBuf key) const {
return Nothing();
}
} else {
Y_ABORT("Unexpected variant case in GetString");
Y_ABORT("Unexpected variant case in Lookup");
}
}

Expand All @@ -347,7 +347,7 @@ TObjectIterator TValue::GetObjectIterator() const {
}
return TObjectIterator(value->GetDictIterator());
} else {
Y_ABORT("Unexpected variant case in GetString");
Y_ABORT("Unexpected variant case in GetObjectIterator");
}
}

Expand Down
4 changes: 2 additions & 2 deletions ydb/library/yql/udfs/common/yson2/yson2_udf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ TUnboxedValuePod LookupImpl(TUnboxedValuePod dict, const TUnboxedValuePod key, c
if (index < 0)
index += size;
if constexpr (Converter != nullptr) {
return Converter(dict.GetElement(index).Release(), valueBuilder, pos);
return Converter(dict.Lookup(TUnboxedValuePod(index)).Release(), valueBuilder, pos);
}
return dict.GetElement(index).Release();
return dict.Lookup(TUnboxedValuePod(index)).Release();
}
}
}
Expand Down

0 comments on commit 0b43a07

Please sign in to comment.