Specify the total memory to use while running the DataFusion plan to `max_memory * memory_fraction` in bytes. This defaults to using [`GreedyMemoryPool`] wrapped in the [`TrackConsumersPool`] with a maximum of 5 consumers. Note DataFusion does not yet respect this limit in all cases.
(self, max_memory: usize, memory_fraction: f64)
| 414 | /// |
| 415 | /// Note DataFusion does not yet respect this limit in all cases. |
| 416 | pub fn with_memory_limit(self, max_memory: usize, memory_fraction: f64) -> Self { |
| 417 | let pool_size = (max_memory as f64 * memory_fraction) as usize; |
| 418 | self.with_memory_pool(Arc::new(TrackConsumersPool::new( |
| 419 | GreedyMemoryPool::new(pool_size), |
| 420 | NonZeroUsize::new(5).unwrap(), |
| 421 | ))) |
| 422 | } |
| 423 | |
| 424 | /// Use the specified path to create any needed temporary files |
| 425 | pub fn with_temp_file_path(mut self, path: impl Into<PathBuf>) -> Self { |