(a: Datum<'a>)
| 2895 | } |
| 2896 | |
| 2897 | fn 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 | |
| 2908 | fn jsonb_each_stringify<'a>( |
| 2909 | a: Datum<'a>, |