alamb opened a new issue, #12137:
URL: https://github.com/apache/datafusion/issues/12137

   ### Is your feature request related to a problem or challenge?
   
   While making a reproducer https://github.com/apache/datafusion/issues/12136, 
I found configuring the SessionContext to use a memory limit and disk manager 
quite akward
   
   Here is what I had to do
   
   ```rust
       let mem_limit = 10 * 1024 * 1024;
       let pool = FairSpillPool::new(mem_limit);
       let config = RuntimeConfig::new()
           .with_memory_pool(Arc::new(pool))
           .with_disk_manager(DiskManagerConfig::new());
   
       let runtime_env = RuntimeEnv::new(config)?;
       let builder = 
SessionStateBuilder::new().with_runtime_env(Arc::new(runtime_env));
   
       let ctx = SessionContext::new_with_state(builder.build());
   ```
   
   
   ### Describe the solution you'd like
   
   It would be nice to have the configurations be more of a builder style
   
   Perhaps the example from above could look something more like the following 
(with some examples):
   
   ```rust
       let mem_limit = 10 * 1024 * 1024;
   
       let runtime_env = RuntimeConfig::new()
           .with_memory_pool(Arc::new(FairSpillPool::new(mem_limit)))
           .with_disk_manager(DiskManagerConfig::new());
           // Change: add a build method to RuntimeConfig to 
           .builder(); 
   
       let builder = SessionStateBuilder::new()
         .with_runtime_env(Arc::new(runtime_env));
   
       let ctx = SessionContext::new_with_state(builder.build());
   ```
   
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to