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

Method eval

src/expr/src/scalar/func/impls/array.rs:58–71  ·  view source on GitHub ↗
(
        &'a self,
        datums: &[Datum<'a>],
        temp_storage: &'a RowArena,
        a: &'a impl Eval,
    )

Source from the content-addressed store, hash-verified

56
57impl LazyUnaryFunc for CastArrayToString {
58 fn eval<'a>(
59 &'a self,
60 datums: &[Datum<'a>],
61 temp_storage: &'a RowArena,
62 a: &'a impl Eval,
63 ) -> Result<Datum<'a>, EvalError> {
64 let a = a.eval(datums, temp_storage)?;
65 if a.is_null() {
66 return Ok(Datum::Null);
67 }
68 let mut buf = String::new();
69 stringify_datum(&mut buf, a, &self.ty)?;
70 Ok(Datum::String(temp_storage.push_string(buf)))
71 }
72
73 fn output_sql_type(&self, input_type: SqlColumnType) -> SqlColumnType {
74 SqlScalarType::String.nullable(input_type.nullable)

Callers 1

packMethod · 0.45

Calls 15

stringify_datumFunction · 0.85
StringClass · 0.85
packFunction · 0.85
push_stringMethod · 0.80
unwrap_arrayMethod · 0.80
elementsMethod · 0.80
dimsMethod · 0.80
packerMethod · 0.80
push_unary_rowMethod · 0.80
try_make_datumMethod · 0.80
try_push_arrayMethod · 0.80
is_nullMethod · 0.45

Tested by

no test coverage detected