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

Function regexp_split_to_array_re

src/expr/src/scalar/func.rs:2323–2339  ·  view source on GitHub ↗
(
    text: &str,
    regexp: &Regex,
    temp_storage: &'a RowArena,
)

Source from the content-addressed store, hash-verified

2321}
2322
2323fn regexp_split_to_array_re<'a>(
2324 text: &str,
2325 regexp: &Regex,
2326 temp_storage: &'a RowArena,
2327) -> Result<Datum<'a>, EvalError> {
2328 let found = mz_regexp::regexp_split_to_array(text, regexp);
2329 let mut row = Row::default();
2330 let mut packer = row.packer();
2331 packer.try_push_array(
2332 &[ArrayDimension {
2333 lower_bound: 1,
2334 length: found.len(),
2335 }],
2336 found.into_iter().map(Datum::String),
2337 )?;
2338 Ok(temp_storage.push_unary_row(row))
2339}
2340
2341#[sqlfunc(propagates_nulls = true)]
2342fn pretty_sql<'a>(sql: &str, width: i32, temp_storage: &'a RowArena) -> Result<&'a str, EvalError> {

Callers 2

regexp_split_to_arrayFunction · 0.85
evalMethod · 0.85

Calls 7

packerMethod · 0.80
try_push_arrayMethod · 0.80
push_unary_rowMethod · 0.80
regexp_split_to_arrayFunction · 0.50
lenMethod · 0.45
mapMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected