From dd2a999496772ef1181f9c4cf1503c01e71cfd82 Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Tue, 1 Oct 2024 11:11:19 +0200 Subject: [PATCH] fix: Divide-by-zero in OOC sort --- crates/polars-pipe/src/executors/sinks/sort/ooc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/polars-pipe/src/executors/sinks/sort/ooc.rs b/crates/polars-pipe/src/executors/sinks/sort/ooc.rs index 1c04f67a34a9..48a2f944b87d 100644 --- a/crates/polars-pipe/src/executors/sinks/sort/ooc.rs +++ b/crates/polars-pipe/src/executors/sinks/sort/ooc.rs @@ -141,7 +141,7 @@ pub(super) fn sort_ooc( .unwrap_or(1 << 26); let samples = samples.to_physical_repr().into_owned(); let spill_size = std::cmp::min( - memtrack.get_available_latest() / (samples.len() * 3), + memtrack.get_available_latest() / (samples.len() * 3 + 1), spill_size, );