Skip to content

Apache DataFusion SQL Query Engine

chore: add function to set prefer_existing_union (#10322)

Nga Tran3b77b6b8e884
diff --git a/datafusion/execution/src/config.rs b/datafusion/execution/src/config.rs
index 28275d484e..2ddad77f99 100644
--- a/datafusion/execution/src/config.rs
+++ b/datafusion/execution/src/config.rs
@@ -331,6 +331,14 @@ impl SessionConfig {
self
}
+ /// Prefer existing union (true). See [prefer_existing_union] for more details
+ ///
+ /// [prefer_existing_union]: datafusion_common::config::OptimizerOptions::prefer_existing_union
+ pub fn with_prefer_existing_union(mut self, enabled: bool) -> Self {
+ self.options.optimizer.prefer_existing_union = enabled;
+ self
+ }
+
/// Enables or disables the use of pruning predicate for parquet readers to skip row groups
pub fn with_parquet_pruning(mut self, enabled: bool) -> Self {
self.options.execution.parquet.pruning = enabled;