File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ use std::fmt::{self, Display};
3636use std:: str:: FromStr ;
3737#[ cfg( feature = "parquet_encryption" ) ]
3838use std:: sync:: Arc ;
39+ use std:: sync:: LazyLock ;
3940
4041/// A macro that wraps a configuration struct and automatically derives
4142/// [`Default`] and [`ConfigField`] for it, allowing it to be used
@@ -1382,12 +1383,21 @@ impl ConfigField for ConfigOptions {
13821383/// (FFI) based configuration extensions.
13831384pub const DATAFUSION_FFI_CONFIG_NAMESPACE : & str = "datafusion_ffi" ;
13841385
1386+ /// Global default configuration options
1387+ static DEFAULT_CONFIG : LazyLock < Arc < ConfigOptions > > =
1388+ LazyLock :: new ( || Arc :: new ( ConfigOptions :: new ( ) ) ) ;
1389+
13851390impl ConfigOptions {
13861391 /// Creates a new [`ConfigOptions`] with default values
13871392 pub fn new ( ) -> Self {
13881393 Self :: default ( )
13891394 }
13901395
1396+ /// Return a reference to the default configuration options
1397+ pub fn default_arc ( ) -> Arc < Self > {
1398+ Arc :: clone ( & DEFAULT_CONFIG )
1399+ }
1400+
13911401 /// Set extensions to provided value
13921402 pub fn with_extensions ( mut self , extensions : Extensions ) -> Self {
13931403 self . extensions = extensions;
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ impl Default for SimplifyContext {
4545 Self {
4646 schema : Arc :: new ( DFSchema :: empty ( ) ) ,
4747 query_execution_start_time : None ,
48- config_options : Arc :: new ( ConfigOptions :: default ( ) ) ,
48+ config_options : ConfigOptions :: default_arc ( ) ,
4949 }
5050 }
5151}
You can’t perform that action at this time.
0 commit comments