pub struct ExecutionState {
pub schema_cache: RwLock<Option<SchemaRef>>,
pub group_tuples: GroupsProxyCache,
pub join_tuples: JoinTuplesCache,
pub branch_idx: usize,
pub flags: AtomicU8,
pub ext_contexts: Arc<Vec<DataFrame>>,
/* private fields */
}
Expand description
State/ cache that is maintained during the Execution of the physical plan.
Fields§
§schema_cache: RwLock<Option<SchemaRef>>
§group_tuples: GroupsProxyCache
Used by Window Expression to prevent redundant grouping
join_tuples: JoinTuplesCache
Used by Window Expression to prevent redundant joins
branch_idx: usize
§flags: AtomicU8
§ext_contexts: Arc<Vec<DataFrame>>
Implementations§
Source§impl ExecutionState
impl ExecutionState
pub fn new() -> Self
Sourcepub fn time_nodes(&mut self)
pub fn time_nodes(&mut self)
Toggle this to measure execution times.
pub fn has_node_timer(&self) -> bool
pub fn finish_timer(self) -> PolarsResult<DataFrame>
pub fn should_stop(&self) -> PolarsResult<()>
pub fn cancel_token(&self) -> Arc<AtomicBool>
pub fn record<T, F: FnOnce() -> T>(&self, func: F, name: Cow<'static, str>) -> T
Sourcepub fn split(&self) -> Self
pub fn split(&self) -> Self
Partially clones and partially clears state This should be used when splitting a node, like a join or union
pub fn set_schema(&self, schema: SchemaRef)
Sourcepub fn clear_schema_cache(&self)
pub fn clear_schema_cache(&self)
Clear the schema. Typically at the end of a projection.
Sourcepub fn get_schema(&self) -> Option<SchemaRef>
pub fn get_schema(&self) -> Option<SchemaRef>
Get the schema.
pub fn get_df_cache( &self, key: usize, cache_hits: u32, ) -> Arc<(AtomicI64, OnceCell<DataFrame>)>
pub fn remove_df_cache(&self, key: usize)
Sourcepub fn clear_window_expr_cache(&self)
pub fn clear_window_expr_cache(&self)
Clear the cache used by the Window expressions
Sourcepub fn cache_window(&self) -> bool
pub fn cache_window(&self) -> bool
Indicates that window expression’s [GroupTuples
] may be cached.
Sourcepub fn has_window(&self) -> bool
pub fn has_window(&self) -> bool
Indicates that window expression’s [GroupTuples
] may be cached.
pub fn remove_cache_window_flag(&mut self)
pub fn insert_cache_window_flag(&mut self)
pub fn insert_has_window_function_flag(&mut self)
Trait Implementations§
Source§impl Clone for ExecutionState
impl Clone for ExecutionState
Auto Trait Implementations§
impl !Freeze for ExecutionState
impl !RefUnwindSafe for ExecutionState
impl Send for ExecutionState
impl Sync for ExecutionState
impl Unpin for ExecutionState
impl !UnwindSafe for ExecutionState
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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