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

Function plan_in_list

src/sql/src/plan/query.rs:4253–4274  ·  view source on GitHub ↗
(
    ecx: &ExprContext,
    lhs: &Expr<Aug>,
    list: &Vec<Expr<Aug>>,
    negated: &bool,
)

Source from the content-addressed store, hash-verified

4251}
4252
4253fn plan_in_list(
4254 ecx: &ExprContext,
4255 lhs: &Expr<Aug>,
4256 list: &Vec<Expr<Aug>>,
4257 negated: &bool,
4258) -> Result<CoercibleScalarExpr, PlanError> {
4259 let ecx = ecx.with_name("IN list");
4260 let or = HirScalarExpr::variadic_or(
4261 list.into_iter()
4262 .map(|e| {
4263 let eq = lhs.clone().equals(e.clone());
4264 plan_expr(&ecx, &eq)?.type_as(&ecx, &SqlScalarType::Bool)
4265 })
4266 .collect::<Result<Vec<HirScalarExpr>, PlanError>>()?,
4267 );
4268 Ok(if *negated {
4269 or.call_unary(UnaryFunc::Not(expr_func::Not))
4270 } else {
4271 or
4272 }
4273 .into())
4274}
4275
4276fn plan_homogenizing_function(
4277 ecx: &ExprContext,

Callers 1

plan_expr_innerFunction · 0.85

Calls 8

plan_exprFunction · 0.85
equalsMethod · 0.80
type_asMethod · 0.80
with_nameMethod · 0.45
mapMethod · 0.45
into_iterMethod · 0.45
cloneMethod · 0.45
call_unaryMethod · 0.45

Tested by

no test coverage detected