Struct datafusion::execution::TaskContext
source · pub struct TaskContext { /* private fields */ }
Expand description
Task Execution Context
A TaskContext
contains the state available during a single
query’s execution. Please see SessionContext
for a user level
multi-query API.
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, Global>, RandomState>,
aggregate_functions: HashMap<String, Arc<AggregateUDF, Global>, RandomState>,
window_functions: HashMap<String, Arc<WindowUDF, Global>, RandomState>,
runtime: Arc<RuntimeEnv, Global>
) -> TaskContext
pub fn new( task_id: Option<String>, session_id: String, session_config: SessionConfig, scalar_functions: HashMap<String, Arc<ScalarUDF, Global>, RandomState>, aggregate_functions: HashMap<String, Arc<AggregateUDF, Global>, RandomState>, window_functions: HashMap<String, Arc<WindowUDF, Global>, RandomState>, runtime: Arc<RuntimeEnv, Global> ) -> TaskContext
Create a new TaskContext
instance.
Most users will use SessionContext::task_ctx
to create TaskContext
s
sourcepub fn try_new(
task_id: String,
session_id: String,
task_props: HashMap<String, String, RandomState>,
scalar_functions: HashMap<String, Arc<ScalarUDF, Global>, RandomState>,
aggregate_functions: HashMap<String, Arc<AggregateUDF, Global>, RandomState>,
runtime: Arc<RuntimeEnv, Global>,
extensions: Extensions
) -> Result<TaskContext, DataFusionError>
👎Deprecated since 21.0.0: Construct SessionConfig and call TaskContext::new() instead
pub fn try_new( task_id: String, session_id: String, task_props: HashMap<String, String, RandomState>, scalar_functions: HashMap<String, Arc<ScalarUDF, Global>, RandomState>, aggregate_functions: HashMap<String, Arc<AggregateUDF, Global>, RandomState>, runtime: Arc<RuntimeEnv, Global>, extensions: Extensions ) -> Result<TaskContext, DataFusionError>
Create a new task context instance, by first copying all
name/value pairs from task_props
into a SessionConfig
.
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, Global>
pub fn memory_pool(&self) -> &Arc<dyn MemoryPool, Global>
Return the MemoryPool
associated with this TaskContext
sourcepub fn runtime_env(&self) -> Arc<RuntimeEnv, Global>
pub fn runtime_env(&self) -> Arc<RuntimeEnv, Global>
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 ConfigOptions
sourcepub fn with_runtime(self, runtime: Arc<RuntimeEnv, Global>) -> TaskContext
pub fn with_runtime(self, runtime: Arc<RuntimeEnv, Global>) -> 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
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
source§impl From<&SessionState> for TaskContext
impl From<&SessionState> for TaskContext
Create a new task context instance from SessionState