Struct datafusion::execution::context::ExecutionConfig
source · [−]pub struct ExecutionConfig {
pub target_partitions: usize,
pub physical_optimizers: Vec<Arc<dyn PhysicalOptimizerRule + Send + Sync>>,
pub repartition_joins: bool,
pub repartition_aggregations: bool,
pub repartition_windows: bool,
pub runtime: RuntimeConfig,
/* private fields */
}
Expand description
Configuration options for execution context
Fields
target_partitions: usize
Number of partitions for query execution. Increasing partitions can increase concurrency.
physical_optimizers: Vec<Arc<dyn PhysicalOptimizerRule + Send + Sync>>
Responsible for optimizing a physical execution plan
repartition_joins: bool
Should DataFusion repartition data using the join keys to execute joins in parallel
using the provided target_partitions
level
repartition_aggregations: bool
Should DataFusion repartition data using the aggregate keys to execute aggregates in parallel
using the provided target_partitions
level
repartition_windows: bool
Should DataFusion repartition data using the partition keys to execute window functions in
parallel using the provided target_partitions
level
runtime: RuntimeConfig
Runtime configurations such as memory threshold and local disk for spill
Implementations
sourceimpl ExecutionConfig
impl ExecutionConfig
sourcepub fn with_target_partitions(self, n: usize) -> Self
pub fn with_target_partitions(self, n: usize) -> Self
Customize target_partitions
sourcepub fn with_batch_size(self, n: usize) -> Self
pub fn with_batch_size(self, n: usize) -> Self
Customize batch size
sourcepub fn with_query_planner(
self,
query_planner: Arc<dyn QueryPlanner + Send + Sync>
) -> Self
pub fn with_query_planner(
self,
query_planner: Arc<dyn QueryPlanner + Send + Sync>
) -> Self
Replace the default query planner
sourcepub fn with_optimizer_rules(
self,
optimizers: Vec<Arc<dyn OptimizerRule + Send + Sync>>
) -> Self
pub fn with_optimizer_rules(
self,
optimizers: Vec<Arc<dyn OptimizerRule + Send + Sync>>
) -> Self
Replace the optimizer rules
sourcepub fn with_physical_optimizer_rules(
self,
physical_optimizers: Vec<Arc<dyn PhysicalOptimizerRule + Send + Sync>>
) -> Self
pub fn with_physical_optimizer_rules(
self,
physical_optimizers: Vec<Arc<dyn PhysicalOptimizerRule + Send + Sync>>
) -> Self
Replace the physical optimizer rules
sourcepub fn add_optimizer_rule(
self,
optimizer_rule: Arc<dyn OptimizerRule + Send + Sync>
) -> Self
pub fn add_optimizer_rule(
self,
optimizer_rule: Arc<dyn OptimizerRule + Send + Sync>
) -> Self
Adds a new OptimizerRule
sourcepub fn add_physical_optimizer_rule(
self,
optimizer_rule: Arc<dyn PhysicalOptimizerRule + Send + Sync>
) -> Self
pub fn add_physical_optimizer_rule(
self,
optimizer_rule: Arc<dyn PhysicalOptimizerRule + Send + Sync>
) -> Self
Adds a new PhysicalOptimizerRule
sourcepub fn with_default_catalog_and_schema(
self,
catalog: impl Into<String>,
schema: impl Into<String>
) -> Self
pub fn with_default_catalog_and_schema(
self,
catalog: impl Into<String>,
schema: impl Into<String>
) -> Self
Selects a name for the default catalog and schema
sourcepub fn create_default_catalog_and_schema(self, create: bool) -> Self
pub fn create_default_catalog_and_schema(self, create: bool) -> Self
Controls whether the default catalog and schema will be automatically created
sourcepub fn with_information_schema(self, enabled: bool) -> Self
pub fn with_information_schema(self, enabled: bool) -> Self
Enables or disables the inclusion of information_schema
virtual tables
sourcepub fn with_repartition_joins(self, enabled: bool) -> Self
pub fn with_repartition_joins(self, enabled: bool) -> Self
Enables or disables the use of repartitioning for joins to improve parallelism
sourcepub fn with_repartition_aggregations(self, enabled: bool) -> Self
pub fn with_repartition_aggregations(self, enabled: bool) -> Self
Enables or disables the use of repartitioning for aggregations to improve parallelism
sourcepub fn with_repartition_windows(self, enabled: bool) -> Self
pub fn with_repartition_windows(self, enabled: bool) -> Self
Enables or disables the use of repartitioning for window functions to improve parallelism
sourcepub fn with_parquet_pruning(self, enabled: bool) -> Self
pub fn with_parquet_pruning(self, enabled: bool) -> Self
Enables or disables the use of pruning predicate for parquet readers to skip row groups
sourcepub fn with_runtime_config(self, config: RuntimeConfig) -> Self
pub fn with_runtime_config(self, config: RuntimeConfig) -> Self
Customize runtime config
sourcepub fn with_existing_memory_manager(self, existing: Arc<MemoryManager>) -> Self
pub fn with_existing_memory_manager(self, existing: Arc<MemoryManager>) -> Self
Use an an existing MemoryManager
sourcepub fn with_memory_limit(
self,
max_memory: usize,
memory_fraction: f64
) -> Result<Self>
pub fn with_memory_limit(
self,
max_memory: usize,
memory_fraction: f64
) -> Result<Self>
Specify the total memory to use while running the DataFusion
plan to max_memory * memory_fraction
in bytes.
Note DataFusion does not yet respect this limit in all cases.
sourcepub fn with_existing_disk_manager(self, existing: Arc<DiskManager>) -> Self
pub fn with_existing_disk_manager(self, existing: Arc<DiskManager>) -> Self
Use an an existing DiskManager
sourcepub fn with_temp_file_path(self, path: impl Into<PathBuf>) -> Self
pub fn with_temp_file_path(self, path: impl Into<PathBuf>) -> Self
Use the specified path to create any needed temporary files
Trait Implementations
sourceimpl Clone for ExecutionConfig
impl Clone for ExecutionConfig
sourcefn clone(&self) -> ExecutionConfig
fn clone(&self) -> ExecutionConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for ExecutionConfig
impl Send for ExecutionConfig
impl Sync for ExecutionConfig
impl Unpin for ExecutionConfig
impl !UnwindSafe for ExecutionConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more