pub struct FunctionExpr { /* private fields */ }Expand description
Expression that evaluates a scalar function and compares the result
This expression wraps a scalar function call with its arguments, evaluates the function for each row, and compares the result to a target value using a comparison operator.
§Example
For UPPER(name) = 'ALICE':
- function: UPPER
- arguments: [ColumnArg(“name”)]
- operator: Eq
- compare_value: Text(“ALICE”)
Implementations§
Source§impl FunctionExpr
impl FunctionExpr
Sourcepub fn new(
function: Arc<dyn ScalarFunction>,
arguments: Vec<FunctionArg>,
operator: Operator,
compare_value: Value,
) -> Self
pub fn new( function: Arc<dyn ScalarFunction>, arguments: Vec<FunctionArg>, operator: Operator, compare_value: Value, ) -> Self
Create a new function expression
§Arguments
function- The scalar function to callarguments- Arguments to pass to the functionoperator- Comparison operatorcompare_value- Value to compare the function result against
Sourcepub fn eq(
function: Arc<dyn ScalarFunction>,
arguments: Vec<FunctionArg>,
compare_value: Value,
) -> Self
pub fn eq( function: Arc<dyn ScalarFunction>, arguments: Vec<FunctionArg>, compare_value: Value, ) -> Self
Create a function expression for equality comparison
Sourcepub fn boolean(
function: Arc<dyn ScalarFunction>,
arguments: Vec<FunctionArg>,
) -> Self
pub fn boolean( function: Arc<dyn ScalarFunction>, arguments: Vec<FunctionArg>, ) -> Self
Create a function expression that evaluates to boolean (no comparison)
This is for functions that return boolean directly, like custom predicates
Sourcepub fn function_name(&self) -> &str
pub fn function_name(&self) -> &str
Get the function name
Sourcepub fn get_arguments(&self) -> &[FunctionArg]
pub fn get_arguments(&self) -> &[FunctionArg]
Get the arguments
Sourcepub fn get_operator(&self) -> Operator
pub fn get_operator(&self) -> Operator
Get the operator
Sourcepub fn get_compare_value(&self) -> &Value
pub fn get_compare_value(&self) -> &Value
Get the compare value
Trait Implementations§
Source§impl Debug for FunctionExpr
impl Debug for FunctionExpr
Source§impl Expression for FunctionExpr
impl Expression for FunctionExpr
Source§fn evaluate_fast(&self, row: &Row) -> bool
fn evaluate_fast(&self, row: &Row) -> bool
Fast evaluation without detailed error handling Read more
Source§fn with_aliases(
&self,
aliases: &FxHashMap<String, String>,
) -> Box<dyn Expression>
fn with_aliases( &self, aliases: &FxHashMap<String, String>, ) -> Box<dyn Expression>
Create a copy of this expression with column aliases resolved Read more
Source§fn prepare_for_schema(&mut self, schema: &Schema)
fn prepare_for_schema(&mut self, schema: &Schema)
Prepare the expression for a specific schema Read more
Source§fn is_prepared(&self) -> bool
fn is_prepared(&self) -> bool
Check if this expression has been prepared for a schema
Source§fn can_use_index(&self) -> bool
fn can_use_index(&self) -> bool
Check if this expression can potentially use an index
Source§fn clone_box(&self) -> Box<dyn Expression>
fn clone_box(&self) -> Box<dyn Expression>
Clone the expression into a boxed trait object
Source§fn get_column_name(&self) -> Option<&str>
fn get_column_name(&self) -> Option<&str>
Get the column name this expression operates on (if single column)
Source§fn get_comparison_info(&self) -> Option<(&str, Operator, &Value)>
fn get_comparison_info(&self) -> Option<(&str, Operator, &Value)>
Extract equality comparison info for index lookups Read more
Source§fn get_and_operands(&self) -> Option<&[Box<dyn Expression>]>
fn get_and_operands(&self) -> Option<&[Box<dyn Expression>]>
Get child expressions if this is an AND expression Read more
Source§fn get_or_operands(&self) -> Option<&[Box<dyn Expression>]>
fn get_or_operands(&self) -> Option<&[Box<dyn Expression>]>
Get child expressions if this is an OR expression Read more
Source§fn get_like_prefix_info(&self) -> Option<(&str, String, bool)>
fn get_like_prefix_info(&self) -> Option<(&str, String, bool)>
Get LIKE prefix info for index range scanning Read more
Auto Trait Implementations§
impl Freeze for FunctionExpr
impl !RefUnwindSafe for FunctionExpr
impl Send for FunctionExpr
impl Sync for FunctionExpr
impl Unpin for FunctionExpr
impl !UnwindSafe for FunctionExpr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more