pub enum Expr {
Show 16 variants
Field(String),
QualifiedField {
qualifier: String,
field: String,
},
Literal(Literal),
Param(String),
BinaryOp(Box<Expr>, BinOp, Box<Expr>),
UnaryOp(UnaryOp, Box<Expr>),
FunctionCall(AggFunc, Box<Expr>),
ScalarFunc(ScalarFn, Vec<Expr>),
Coalesce(Box<Expr>, Box<Expr>),
InList {
expr: Box<Expr>,
list: Vec<Expr>,
negated: bool,
},
InSubquery {
expr: Box<Expr>,
subquery: Box<QueryExpr>,
negated: bool,
},
ExistsSubquery {
subquery: Box<QueryExpr>,
negated: bool,
},
Case {
whens: Vec<(Box<Expr>, Box<Expr>)>,
else_expr: Option<Box<Expr>>,
},
Window {
function: WindowFunc,
args: Vec<Expr>,
partition_by: Vec<String>,
order_by: Vec<OrderKey>,
},
Cast(Box<Expr>, CastType),
Null,
}Expand description
Expressions.
Variants§
Field(String)
QualifiedField
A table-qualified field reference: table.field or alias.field.
Used by join queries to disambiguate columns that appear in multiple
sources. The single-table read path never emits this variant, so
existing fast paths keep matching Expr::Field unchanged.
Literal(Literal)
Param(String)
BinaryOp(Box<Expr>, BinOp, Box<Expr>)
UnaryOp(UnaryOp, Box<Expr>)
FunctionCall(AggFunc, Box<Expr>)
ScalarFunc(ScalarFn, Vec<Expr>)
Scalar (non-aggregate) function call.
Coalesce(Box<Expr>, Box<Expr>)
InList
expr in (val1, val2, ...) or expr not in (val1, val2, ...)
InSubquery
expr [not] in (subquery) — the subquery is a full QueryExpr
that produces a single column.
ExistsSubquery
[not] exists (subquery) — the subquery is a full QueryExpr.
Currently uncorrelated only: the executor runs the subquery once
before the scan loop and replaces this node with a Bool literal.
Case
CASE WHEN … THEN … [ELSE …] END
Window
Window function: func(args) over (partition ... order ...)
Cast(Box<Expr>, CastType)
Type cast: cast(expr, "int") or cast(expr, "str") etc.
Null
The null literal — produces Value::Empty.