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

Method call

src/expr/src/scalar/func/impls/string.rs:184–192  ·  view source on GitHub ↗
(&self, a: Self::Input<'a>)

Source from the content-addressed store, hash-verified

182 type Output<'a> = Result<Numeric, EvalError>;
183
184 fn call<'a>(&self, a: Self::Input<'a>) -> Self::Output<'a> {
185 let mut d = strconv::parse_numeric(a)?;
186 if let Some(scale) = self.0 {
187 if numeric::rescale(&mut d.0, scale.into_u8()).is_err() {
188 return Err(EvalError::NumericFieldOverflow);
189 }
190 }
191 Ok(d.into_inner())
192 }
193
194 fn output_sql_type(&self, input: SqlColumnType) -> SqlColumnType {
195 SqlScalarType::Numeric { max_scale: self.0 }.nullable(input.nullable)

Callers

nothing calls this directly

Calls 14

parse_numericFunction · 0.85
rescaleFunction · 0.85
parse_timestampFunction · 0.85
parse_timestamptzFunction · 0.85
format_str_trimFunction · 0.85
format_strFunction · 0.85
round_to_precisionMethod · 0.80
unwrapMethod · 0.80
CharClass · 0.50
VarCharClass · 0.50
into_u8Method · 0.45
into_innerMethod · 0.45

Tested by

no test coverage detected