File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ use arrow::{
22
22
compute:: SortOptions ,
23
23
record_batch:: RecordBatch ,
24
24
} ;
25
- use datafusion:: execution:: runtime_env:: { RuntimeConfig , RuntimeEnv } ;
25
+ use datafusion:: execution:: runtime_env:: RuntimeConfig ;
26
26
use datafusion:: physical_plan:: expressions:: PhysicalSortExpr ;
27
27
use datafusion:: physical_plan:: memory:: MemoryExec ;
28
28
use datafusion:: physical_plan:: sorts:: sort:: SortExec ;
@@ -136,9 +136,10 @@ impl SortTest {
136
136
. sort_spill_reservation_bytes ,
137
137
) ;
138
138
139
- let runtime_config = RuntimeConfig :: new ( )
140
- . with_memory_pool ( Arc :: new ( GreedyMemoryPool :: new ( pool_size) ) ) ;
141
- let runtime = Arc :: new ( RuntimeEnv :: new ( runtime_config) . unwrap ( ) ) ;
139
+ let runtime_env = RuntimeConfig :: new ( )
140
+ . with_memory_pool ( Arc :: new ( GreedyMemoryPool :: new ( pool_size) ) )
141
+ . build ( ) ;
142
+ let runtime = Arc :: new ( runtime_env. unwrap ( ) ) ;
142
143
SessionContext :: new_with_config_rt ( session_config, runtime)
143
144
} else {
144
145
SessionContext :: new_with_config ( session_config)
Original file line number Diff line number Diff line change @@ -228,4 +228,9 @@ impl RuntimeConfig {
228
228
pub fn with_temp_file_path ( self , path : impl Into < PathBuf > ) -> Self {
229
229
self . with_disk_manager ( DiskManagerConfig :: new_specified ( vec ! [ path. into( ) ] ) )
230
230
}
231
+
232
+ /// Build a `RuntimeEnv` object from the configuration
233
+ pub fn build ( self ) -> Result < RuntimeEnv > {
234
+ RuntimeEnv :: new ( self )
235
+ }
231
236
}
You can’t perform that action at this time.
0 commit comments