From c0dc063756b9b35a1e01754db5b27610843c1f0c Mon Sep 17 00:00:00 2001 From: ritchie Date: Fri, 10 Jan 2025 16:49:47 +0100 Subject: [PATCH] Don't do partitioned if key is given as series --- crates/polars-mem-engine/src/planner/lp.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/polars-mem-engine/src/planner/lp.rs b/crates/polars-mem-engine/src/planner/lp.rs index 3158651aaa1..6981cc1d255 100644 --- a/crates/polars-mem-engine/src/planner/lp.rs +++ b/crates/polars-mem-engine/src/planner/lp.rs @@ -25,7 +25,11 @@ fn partitionable_gb( // complex expressions in the group_by itself are also not partitionable // in this case anything more than col("foo") for key in keys { - if (expr_arena).iter(key.node()).count() > 1 { + if (expr_arena).iter(key.node()).count() > 1 + || has_aexpr(key.node(), expr_arena, |ae| { + matches!(ae, AExpr::Literal(LiteralValue::Series(_))) + }) + { return false; } }