From e3796f7b33e3dfa777883d8353e4c6f92de3d42c Mon Sep 17 00:00:00 2001 From: Nga Tran Date: Tue, 30 Apr 2024 17:49:14 -0400 Subject: [PATCH] chore: add function to set prefer_existing_union (#10322) --- datafusion/execution/src/config.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/datafusion/execution/src/config.rs b/datafusion/execution/src/config.rs index 28275d484e29..2ddad77f9971 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;