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 builder() -> SimplifyContextBuilder
pub fn builder() -> SimplifyContextBuilder
Returns a builder for SimplifyContext.
Sourcepub fn with_config_options(self, config_options: Arc<ConfigOptions>) -> Self
👎Deprecated since 54.0.0: Use SimplifyContextBuilder if you intend to use non-default values.
pub fn with_config_options(self, config_options: Arc<ConfigOptions>) -> Self
Use SimplifyContextBuilder if you intend to use non-default values.
Set the ConfigOptions for this context
Sourcepub fn with_schema(self, schema: DFSchemaRef) -> Self
👎Deprecated since 54.0.0: Use SimplifyContextBuilder if you intend to use non-default values.
pub fn with_schema(self, schema: DFSchemaRef) -> Self
Use SimplifyContextBuilder if you intend to use non-default values.
Set the schema for this context
Sourcepub fn with_query_execution_start_time(
self,
query_execution_start_time: Option<DateTime<Utc>>,
) -> Self
👎Deprecated since 54.0.0: Use SimplifyContextBuilder if you intend to use non-default values.
pub fn with_query_execution_start_time( self, query_execution_start_time: Option<DateTime<Utc>>, ) -> Self
Use SimplifyContextBuilder if you intend to use non-default values.
Set the query execution start time
Sourcepub fn with_current_time(self) -> Self
👎Deprecated since 54.0.0: Use SimplifyContextBuilder if you intend to use non-default values.
pub fn with_current_time(self) -> Self
Use SimplifyContextBuilder if you intend to use non-default values.
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
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 SimplifyContext
impl Debug for SimplifyContext
Auto Trait Implementations§
impl !RefUnwindSafe for SimplifyContext
impl !UnwindSafe for SimplifyContext
impl Freeze for SimplifyContext
impl Send for SimplifyContext
impl Sync for SimplifyContext
impl Unpin for SimplifyContext
impl UnsafeUnpin 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
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>
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>
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