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

Function parse_literal_list

src/expr-parser/src/parser.rs:1096–1108  ·  view source on GitHub ↗
(input: ParseStream)

Source from the content-addressed store, hash-verified

1094 Ok(MirScalarExpr::literal_ok(datum, typ))
1095 }
1096 fn parse_literal_list(input: ParseStream) -> Result {
1097 use mz_expr::func::variadic::ListCreate;
1098
1099 let elem_type = SqlScalarType::Int64; // FIXME
1100 let func = VariadicFunc::ListCreate(ListCreate { elem_type });
1101 let exprs = input.parse_comma_sep(parse_literal_ok)?;
1102
1103 // Evaluate into a datum
1104 let temp_storage = RowArena::default();
1105 let datum = func.eval(&[], &temp_storage, &exprs).expect("datum");
1106 let typ = ReprScalarType::from(&SqlScalarType::Array(Box::new(SqlScalarType::Int64))); // FIXME
1107 Ok(MirScalarExpr::literal_ok(datum, typ))
1108 }
1109 fn parse_array(input: ParseStream) -> Result {
1110 use mz_expr::func::variadic::ArrayCreate;
1111

Callers 1

parse_operandFunction · 0.85

Calls 5

ListCreateClass · 0.85
ArrayClass · 0.85
parse_comma_sepMethod · 0.80
expectMethod · 0.80
evalMethod · 0.45

Tested by

no test coverage detected