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 + Sync + Send>,
) -> Result<(), DataFusionError>
fn register_function_rewrite( &mut self, _rewrite: Arc<dyn FunctionRewrite + Sync + Send>, ) -> 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