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

Function jsonb_each

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

Source from the content-addressed store, hash-verified

2895}
2896
2897fn jsonb_each<'a>(a: Datum<'a>) -> impl Iterator<Item = (Row, Diff)> + 'a {
2898 // First produce a map, so that a common iterator can be returned.
2899 let map = match a {
2900 Datum::Map(dict) => dict,
2901 _ => mz_repr::DatumMap::empty(),
2902 };
2903
2904 map.iter()
2905 .map(move |(k, v)| (Row::pack_slice(&[Datum::String(k), v]), Diff::ONE))
2906}
2907
2908fn jsonb_each_stringify<'a>(
2909 a: Datum<'a>,

Callers 1

evalMethod · 0.85

Calls 3

StringClass · 0.85
mapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected