Struct datafusion_execution::TaskContext
source · pub struct TaskContext { /* private fields */ }
Expand description
Task Execution Context
A TaskContext
contains the state required during a single query’s
execution. Please see the documentation on SessionContext
for more
information.
Implementations§
source§impl TaskContext
impl TaskContext
sourcepub fn new(
task_id: Option<String>,
session_id: String,
session_config: SessionConfig,
scalar_functions: HashMap<String, Arc<ScalarUDF>>,
aggregate_functions: HashMap<String, Arc<AggregateUDF>>,
window_functions: HashMap<String, Arc<WindowUDF>>,
runtime: Arc<RuntimeEnv>,
) -> Self
pub fn new( task_id: Option<String>, session_id: String, session_config: SessionConfig, scalar_functions: HashMap<String, Arc<ScalarUDF>>, aggregate_functions: HashMap<String, Arc<AggregateUDF>>, window_functions: HashMap<String, Arc<WindowUDF>>, runtime: Arc<RuntimeEnv>, ) -> Self
Create a new TaskContext
instance.
Most users will use SessionContext::task_ctx
to create TaskContext
s
sourcepub fn session_config(&self) -> &SessionConfig
pub fn session_config(&self) -> &SessionConfig
Return the SessionConfig associated with this TaskContext
sourcepub fn session_id(&self) -> String
pub fn session_id(&self) -> String
Return the session_id
of this TaskContext
sourcepub fn task_id(&self) -> Option<String>
pub fn task_id(&self) -> Option<String>
Return the task_id
of this TaskContext
sourcepub fn memory_pool(&self) -> &Arc<dyn MemoryPool>
pub fn memory_pool(&self) -> &Arc<dyn MemoryPool>
Return the MemoryPool
associated with this TaskContext
sourcepub fn runtime_env(&self) -> Arc<RuntimeEnv>
pub fn runtime_env(&self) -> Arc<RuntimeEnv>
Return the RuntimeEnv associated with this TaskContext
sourcepub fn with_session_config(self, session_config: SessionConfig) -> Self
pub fn with_session_config(self, session_config: SessionConfig) -> Self
Update the SessionConfig
sourcepub fn with_runtime(self, runtime: Arc<RuntimeEnv>) -> Self
pub fn with_runtime(self, runtime: Arc<RuntimeEnv>) -> Self
Update the RuntimeEnv
Trait Implementations§
source§impl Debug for TaskContext
impl Debug for TaskContext
source§impl Default for TaskContext
impl Default for TaskContext
source§impl FunctionRegistry for TaskContext
impl FunctionRegistry for TaskContext
source§fn udf(&self, name: &str) -> Result<Arc<ScalarUDF>>
fn udf(&self, name: &str) -> Result<Arc<ScalarUDF>>
Returns a reference to the user defined scalar function (udf) named
name
.source§fn udaf(&self, name: &str) -> Result<Arc<AggregateUDF>>
fn udaf(&self, name: &str) -> Result<Arc<AggregateUDF>>
Returns a reference to the user defined aggregate function (udaf) named
name
.source§fn udwf(&self, name: &str) -> Result<Arc<WindowUDF>>
fn udwf(&self, name: &str) -> Result<Arc<WindowUDF>>
Returns a reference to the user defined window function (udwf) named
name
.source§fn register_udaf(
&mut self,
udaf: Arc<AggregateUDF>,
) -> Result<Option<Arc<AggregateUDF>>>
fn register_udaf( &mut self, udaf: Arc<AggregateUDF>, ) -> Result<Option<Arc<AggregateUDF>>>
Registers a new
AggregateUDF
, returning any previously registered
implementation. Read moresource§fn expr_planners(&self) -> Vec<Arc<dyn ExprPlanner>>
fn expr_planners(&self) -> Vec<Arc<dyn ExprPlanner>>
Set of all registered
ExprPlanner
ssource§fn deregister_udf(
&mut self,
_name: &str,
) -> Result<Option<Arc<ScalarUDF>>, DataFusionError>
fn deregister_udf( &mut self, _name: &str, ) -> Result<Option<Arc<ScalarUDF>>, DataFusionError>
source§fn deregister_udaf(
&mut self,
_name: &str,
) -> Result<Option<Arc<AggregateUDF>>, DataFusionError>
fn deregister_udaf( &mut self, _name: &str, ) -> Result<Option<Arc<AggregateUDF>>, DataFusionError>
Deregisters a
AggregateUDF
, returning the implementation that was
deregistered. Read moresource§fn deregister_udwf(
&mut self,
_name: &str,
) -> Result<Option<Arc<WindowUDF>>, DataFusionError>
fn deregister_udwf( &mut self, _name: &str, ) -> Result<Option<Arc<WindowUDF>>, DataFusionError>
source§fn register_function_rewrite(
&mut self,
_rewrite: Arc<dyn FunctionRewrite + Send + Sync>,
) -> Result<(), DataFusionError>
fn register_function_rewrite( &mut self, _rewrite: Arc<dyn FunctionRewrite + Send + Sync>, ) -> Result<(), DataFusionError>
Registers a new
FunctionRewrite
with the registry. Read moresource§fn register_expr_planner(
&mut self,
_expr_planner: Arc<dyn ExprPlanner>,
) -> Result<(), DataFusionError>
fn register_expr_planner( &mut self, _expr_planner: Arc<dyn ExprPlanner>, ) -> Result<(), DataFusionError>
Registers a new
ExprPlanner
with the registry.Auto Trait Implementations§
impl Freeze for TaskContext
impl !RefUnwindSafe for TaskContext
impl Send for TaskContext
impl Sync for TaskContext
impl Unpin for TaskContext
impl !UnwindSafe for TaskContext
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