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

Method typ

src/expr/src/scalar.rs:1083–1101  ·  view source on GitHub ↗
(&self, column_types: &[ReprColumnType])

Source from the content-addressed store, hash-verified

1081 }
1082
1083 pub fn typ(&self, column_types: &[ReprColumnType]) -> ReprColumnType {
1084 match self {
1085 MirScalarExpr::Column(i, _name) => column_types[*i].clone(),
1086 MirScalarExpr::Literal(_, typ) => typ.clone(),
1087 MirScalarExpr::CallUnmaterializable(func) => func.output_type(),
1088 MirScalarExpr::CallUnary { expr, func } => func.output_type(expr.typ(column_types)),
1089 MirScalarExpr::CallBinary { expr1, expr2, func } => {
1090 func.output_type(&[expr1.typ(column_types), expr2.typ(column_types)])
1091 }
1092 MirScalarExpr::CallVariadic { exprs, func } => {
1093 func.output_type(exprs.iter().map(|e| e.typ(column_types)).collect())
1094 }
1095 MirScalarExpr::If { cond: _, then, els } => {
1096 let then_type = then.typ(column_types);
1097 let else_type = els.typ(column_types);
1098 then_type.union(&else_type).unwrap()
1099 }
1100 }
1101 }
1102
1103 /// True iff the expression contains
1104 /// `UnmaterializableFunc::MzNow`.

Callers 15

bindMethod · 0.45
send_rowsMethod · 0.45
copy_rowsMethod · 0.45
copy_from_innerMethod · 0.45
sql_typMethod · 0.45
enforce_linear_chainsFunction · 0.45
canonicalize_predicatesFunction · 0.45
reduce_preFunction · 0.45
reduce_call_unaryFunction · 0.45
reduce_call_binaryFunction · 0.45

Calls 7

unwrapMethod · 0.80
cloneMethod · 0.45
output_typeMethod · 0.45
collectMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
unionMethod · 0.45

Tested by

no test coverage detected