Skip to content
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

Fix some bugs in jsonpath #9146

Merged
merged 5 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
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
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
Loading