pub struct SimplifyContext { /* private fields */ }Expand description
Provides simplification information based on schema, query execution time, and configuration options.
§Example
See the simplify_demo in the expr_api example
Implementations§
Source§impl SimplifyContext
impl SimplifyContext
Sourcepub fn with_config_options(self, config_options: Arc<ConfigOptions>) -> Self
pub fn with_config_options(self, config_options: Arc<ConfigOptions>) -> Self
Set the ConfigOptions for this context
Sourcepub fn with_schema(self, schema: DFSchemaRef) -> Self
pub fn with_schema(self, schema: DFSchemaRef) -> Self
Set the schema for this context
Sourcepub fn with_query_execution_start_time(
self,
query_execution_start_time: Option<DateTime<Utc>>,
) -> Self
pub fn with_query_execution_start_time( self, query_execution_start_time: Option<DateTime<Utc>>, ) -> Self
Set the query execution start time
Sourcepub fn with_current_time(self) -> Self
pub fn with_current_time(self) -> Self
Set the query execution start to the current time
Sourcepub fn schema(&self) -> &DFSchemaRef
pub fn schema(&self) -> &DFSchemaRef
Returns the schema
Sourcepub fn is_boolean_type(&self, expr: &Expr) -> Result<bool>
pub fn is_boolean_type(&self, expr: &Expr) -> Result<bool>
Returns true if this Expr has boolean type
Sourcepub fn get_data_type(&self, expr: &Expr) -> Result<DataType>
pub fn get_data_type(&self, expr: &Expr) -> Result<DataType>
Returns data type of this expr needed for determining optimized int type of a value
Sourcepub fn query_execution_start_time(&self) -> Option<DateTime<Utc>>
pub fn query_execution_start_time(&self) -> Option<DateTime<Utc>>
Returns the time at which the query execution started.
If None, time-dependent functions like now() will not be simplified.
Sourcepub fn config_options(&self) -> &Arc<ConfigOptions>
pub fn config_options(&self) -> &Arc<ConfigOptions>
Returns the configuration options for the session.
Trait Implementations§
Source§impl Clone for SimplifyContext
impl Clone for SimplifyContext
Source§fn clone(&self) -> SimplifyContext
fn clone(&self) -> SimplifyContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SimplifyContext
impl Debug for SimplifyContext
Auto Trait Implementations§
impl Freeze for SimplifyContext
impl !RefUnwindSafe for SimplifyContext
impl Send for SimplifyContext
impl Sync for SimplifyContext
impl Unpin for SimplifyContext
impl UnsafeUnpin for SimplifyContext
impl !UnwindSafe for SimplifyContext
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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