MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / jsonb_object_keys

Function jsonb_object_keys

src/expr/src/relation/func.rs:2926–2934  ·  view source on GitHub ↗
(a: Datum<'a>)

Source from the content-addressed store, hash-verified

2924}
2925
2926fn jsonb_object_keys<'a>(a: Datum<'a>) -> impl Iterator<Item = (Row, Diff)> + 'a {
2927 let map = match a {
2928 Datum::Map(dict) => dict,
2929 _ => mz_repr::DatumMap::empty(),
2930 };
2931
2932 map.iter()
2933 .map(move |(k, _)| (Row::pack_slice(&[Datum::String(k)]), Diff::ONE))
2934}
2935
2936fn jsonb_array_elements<'a>(a: Datum<'a>) -> impl Iterator<Item = (Row, Diff)> + 'a {
2937 let list = match a {

Callers 1

evalMethod · 0.85

Calls 3

StringClass · 0.85
mapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected