Skip to content

Commit

Permalink
Use FairSpillPool for TaskContext with spillable config
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Nov 7, 2023
1 parent 3469c4e commit a4bf403
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions datafusion/physical-plan/src/aggregates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,7 @@ mod tests {
AggregateExpr, EquivalenceProperties, PhysicalExpr, PhysicalSortExpr,
};

use datafusion_execution::memory_pool::FairSpillPool;
use futures::{FutureExt, Stream};

// Generate a schema which consists of 5 columns (a, b, c, d, e)
Expand Down Expand Up @@ -1271,8 +1272,11 @@ mod tests {
fn new_spill_ctx(batch_size: usize, max_memory: usize) -> Arc<TaskContext> {
let session_config = SessionConfig::new().with_batch_size(batch_size);
let runtime = Arc::new(
RuntimeEnv::new(RuntimeConfig::default().with_memory_limit(max_memory, 1.0))
.unwrap(),
RuntimeEnv::new(
RuntimeConfig::default()
.with_memory_pool(Arc::new(FairSpillPool::new(max_memory))),
)
.unwrap(),
);
let task_ctx = TaskContext::default()
.with_session_config(session_config)
Expand Down

0 comments on commit a4bf403

Please sign in to comment.