pub enum SelectExpression {
Column(ColumnRef),
Aggregate(AggregateFunction),
Function(FunctionCall),
WriteTimeTtl(WriteTimeTtlCall),
Literal(Value),
BindMarker(usize),
CollectionAccess(CollectionAccessExpression),
Arithmetic(ArithmeticExpression),
Aliased(Box<SelectExpression>, String),
}Expand description
Expression in SELECT clause
Variants§
Column(ColumnRef)
Simple column reference
Aggregate(AggregateFunction)
Aggregate function
Function(FunctionCall)
Scalar function
WriteTimeTtl(WriteTimeTtlCall)
WRITETIME(col) or TTL(col) — first-class metadata-retrieval functions.
Using a dedicated variant avoids downstream string-matching on the function name and keeps the executor dispatch explicit and exhaustive.
Literal(Value)
Literal value
BindMarker(usize)
Positional bind marker (?) carrying its 0-based index in the statement.
Issue #961: produced by the SELECT parser whenever it encounters a ?
placeholder in a value position (e.g. the RHS of a WHERE comparison). It
is a transient node: parameter binding
(bind_parameters) rewrites every BindMarker(i) into the corresponding
Literal(params[i]) before the statement reaches the optimizer or
executor. Reaching execution with an unbound marker is a logic error and
surfaces as a query-execution error rather than a panic.
CollectionAccess(CollectionAccessExpression)
Collection access (list[0], map[‘key’])
Arithmetic(ArithmeticExpression)
Arithmetic expression
Aliased(Box<SelectExpression>, String)
Aliased expression (expr AS alias)
Implementations§
Source§impl SelectExpression
impl SelectExpression
Sourcepub fn is_aggregate(&self) -> bool
pub fn is_aggregate(&self) -> bool
Check if this expression is an aggregate function.
An aliased aggregate (COUNT(*) AS total) is still an aggregate: unwrap
Aliased so SELECT COUNT(*) AS total is planned through the aggregation
step rather than falling into row-level projection (issue #1763).
Sourcepub fn get_column_refs(&self) -> Vec<ColumnRef>
pub fn get_column_refs(&self) -> Vec<ColumnRef>
Get all column references in this expression
Trait Implementations§
Source§impl Clone for SelectExpression
impl Clone for SelectExpression
Source§fn clone(&self) -> SelectExpression
fn clone(&self) -> SelectExpression
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SelectExpression
impl Debug for SelectExpression
Source§impl<'de> Deserialize<'de> for SelectExpression
impl<'de> Deserialize<'de> for SelectExpression
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SelectExpression
impl PartialEq for SelectExpression
Source§fn eq(&self, other: &SelectExpression) -> bool
fn eq(&self, other: &SelectExpression) -> bool
self and other values to be equal, and is used by ==.