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>,
) -> TaskContext
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>, ) -> TaskContext
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) -> TaskContext
pub fn with_session_config(self, session_config: SessionConfig) -> TaskContext
Update the SessionConfig
Sourcepub fn with_runtime(self, runtime: Arc<RuntimeEnv>) -> TaskContext
pub fn with_runtime(self, runtime: Arc<RuntimeEnv>) -> TaskContext
Update the RuntimeEnv
Trait Implementations§
Source§impl Debug for TaskContext
impl Debug for TaskContext
Source§impl Default for TaskContext
impl Default for TaskContext
Source§fn default() -> TaskContext
fn default() -> TaskContext
Returns the “default value” for a type. Read more
Source§impl From<&SessionContext> for TaskContext
impl From<&SessionContext> for TaskContext
Create a new task context instance from SessionContext
Source§fn from(session: &SessionContext) -> Self
fn from(session: &SessionContext) -> Self
Converts to this type from the input type.
Source§impl From<&SessionState> for TaskContext
impl From<&SessionState> for TaskContext
Create a new task context instance from SessionState
Source§fn from(state: &SessionState) -> Self
fn from(state: &SessionState) -> Self
Converts to this type from the input type.
Source§impl From<&dyn Session> for TaskContext
impl From<&dyn Session> for TaskContext
Create a new task context instance from Session
Source§fn from(state: &dyn Session) -> TaskContext
fn from(state: &dyn Session) -> TaskContext
Converts to this type from the input type.
Source§impl FunctionRegistry for TaskContext
impl FunctionRegistry for TaskContext
Source§fn udf(&self, name: &str) -> Result<Arc<ScalarUDF>, DataFusionError>
fn udf(&self, name: &str) -> Result<Arc<ScalarUDF>, DataFusionError>
Returns a reference to the user defined scalar function (udf) named
name
.Source§fn udaf(&self, name: &str) -> Result<Arc<AggregateUDF>, DataFusionError>
fn udaf(&self, name: &str) -> Result<Arc<AggregateUDF>, DataFusionError>
Returns a reference to the user defined aggregate function (udaf) named
name
.Source§fn udwf(&self, name: &str) -> Result<Arc<WindowUDF>, DataFusionError>
fn udwf(&self, name: &str) -> Result<Arc<WindowUDF>, DataFusionError>
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>>, DataFusionError>
fn register_udaf( &mut self, udaf: Arc<AggregateUDF>, ) -> Result<Option<Arc<AggregateUDF>>, DataFusionError>
Registers a new
AggregateUDF
, returning any previously registered
implementation. Read moreSource§fn register_udwf(
&mut self,
udwf: Arc<WindowUDF>,
) -> Result<Option<Arc<WindowUDF>>, DataFusionError>
fn register_udwf( &mut self, udwf: Arc<WindowUDF>, ) -> Result<Option<Arc<WindowUDF>>, DataFusionError>
Source§fn register_udf(
&mut self,
udf: Arc<ScalarUDF>,
) -> Result<Option<Arc<ScalarUDF>>, DataFusionError>
fn register_udf( &mut self, udf: Arc<ScalarUDF>, ) -> Result<Option<Arc<ScalarUDF>>, DataFusionError>
Source§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