MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / rebuild_and

Function rebuild_and

nodedb-sql/src/engine_rules/mod.rs:355–366  ·  view source on GitHub ↗

Reassemble a list of conjuncts into a right-leaning AND tree. Empty input returns `None`; single input returns itself.

(mut conjuncts: Vec<SqlExpr>)

Source from the content-addressed store, hash-verified

353/// Reassemble a list of conjuncts into a right-leaning AND tree.
354/// Empty input returns `None`; single input returns itself.
355fn rebuild_and(mut conjuncts: Vec<SqlExpr>) -> Option<SqlExpr> {
356 let last = conjuncts.pop()?;
357 Some(
358 conjuncts
359 .into_iter()
360 .rfold(last, |acc, next| SqlExpr::BinaryOp {
361 left: Box::new(next),
362 op: BinaryOp::And,
363 right: Box::new(acc),
364 }),
365 )
366}
367
368/// Decide whether the query's WHERE conjuncts entail the partial-index
369/// predicate. `None` predicate means a full index — trivially entailed.

Callers 1

split_equality_from_exprFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected