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

Function jsonb_array_elements_stringify

src/expr/src/relation/func.rs:2944–2958  ·  view source on GitHub ↗
(
    a: Datum<'a>,
    temp_storage: &'a RowArena,
)

Source from the content-addressed store, hash-verified

2942}
2943
2944fn jsonb_array_elements_stringify<'a>(
2945 a: Datum<'a>,
2946 temp_storage: &'a RowArena,
2947) -> impl Iterator<Item = (Row, Diff)> + 'a {
2948 let list = match a {
2949 Datum::List(list) => list,
2950 _ => mz_repr::DatumList::empty(),
2951 };
2952 list.iter().map(move |mut e| {
2953 e = jsonb_stringify(e, temp_storage)
2954 .map(Datum::String)
2955 .unwrap_or(Datum::Null);
2956 (Row::pack_slice(&[e]), Diff::ONE)
2957 })
2958}
2959
2960fn regexp_extract(a: Datum, r: &AnalyzedRegex) -> Option<(Row, Diff)> {
2961 let r = r.inner();

Callers 1

evalMethod · 0.85

Calls 3

jsonb_stringifyFunction · 0.85
mapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected