Expand description
A lookup-based evaluation of CASE expr WHEN lit1 THEN res1 ... ELSE els END.
CaseLiteral replaces chains of If(Eq(expr, literal), result, If(...))
with a single BTreeMap lookup, turning O(n) evaluation into O(log n).
Represented as a CallVariadic { func: CaseLiteral { lookup, return_type }, exprs }
where:
exprs[0]= input expression (thexinCASE x WHEN ...)exprs[1..n]= case result expressionsexprs[last]=els(fallback)lookup: BTreeMap<Row, usize>maps literal values to indices inexprs
Structsยง
- Case
Literal - Evaluates a CASE expression by looking up the input datum in a
BTreeMap.