Skip to content

Commit 6befac2

Browse files
author
Vadim Averin
authored
Fix some bugs in jsonpath (#9146)
1 parent c50551f commit 6befac2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

ydb/library/yql/minikql/jsonpath/value.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ ui32 TValue::GetSize() const {
277277
return value->GetDictLength();
278278
}
279279
} else {
280-
Y_ABORT("Unexpected variant case in GetString");
280+
Y_ABORT("Unexpected variant case in GetSize");
281281
}
282282
}
283283

@@ -287,9 +287,9 @@ TValue TValue::GetElement(ui32 index) const {
287287
if (const auto* value = std::get_if<TContainerCursor>(&Value)) {
288288
return TValue(value->GetElement(index));
289289
} else if (const auto* value = std::get_if<TUnboxedValue>(&Value)) {
290-
return TValue(value->GetElement(index));
290+
return TValue(value->Lookup(TUnboxedValuePod(index)));
291291
} else {
292-
Y_ABORT("Unexpected variant case in GetString");
292+
Y_ABORT("Unexpected variant case in GetElement");
293293
}
294294
}
295295

@@ -304,7 +304,7 @@ TArrayIterator TValue::GetArrayIterator() const {
304304
}
305305
return TArrayIterator(value->GetListIterator());
306306
} else {
307-
Y_ABORT("Unexpected variant case in GetString");
307+
Y_ABORT("Unexpected variant case in GetArrayIterator");
308308
}
309309
}
310310

@@ -332,7 +332,7 @@ TMaybe<TValue> TValue::Lookup(const TStringBuf key) const {
332332
return Nothing();
333333
}
334334
} else {
335-
Y_ABORT("Unexpected variant case in GetString");
335+
Y_ABORT("Unexpected variant case in Lookup");
336336
}
337337
}
338338

@@ -347,7 +347,7 @@ TObjectIterator TValue::GetObjectIterator() const {
347347
}
348348
return TObjectIterator(value->GetDictIterator());
349349
} else {
350-
Y_ABORT("Unexpected variant case in GetString");
350+
Y_ABORT("Unexpected variant case in GetObjectIterator");
351351
}
352352
}
353353

ydb/library/yql/udfs/common/yson2/yson2_udf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ TUnboxedValuePod LookupImpl(TUnboxedValuePod dict, const TUnboxedValuePod key, c
313313
if (index < 0)
314314
index += size;
315315
if constexpr (Converter != nullptr) {
316-
return Converter(dict.GetElement(index).Release(), valueBuilder, pos);
316+
return Converter(dict.Lookup(TUnboxedValuePod(index)).Release(), valueBuilder, pos);
317317
}
318-
return dict.GetElement(index).Release();
318+
return dict.Lookup(TUnboxedValuePod(index)).Release();
319319
}
320320
}
321321
}

0 commit comments

Comments
 (0)