From 942cb177a484f5c54a7088e95ec8d18ab15354a5 Mon Sep 17 00:00:00 2001 From: "Heres, Daniel" Date: Thu, 3 Nov 2022 18:06:57 +0100 Subject: [PATCH] Tweak Tweak --- datafusion/core/src/physical_plan/planner.rs | 2 +- .../optimizer/src/simplify_expressions/expr_simplifier.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/datafusion/core/src/physical_plan/planner.rs b/datafusion/core/src/physical_plan/planner.rs index a389bb65bdc7..ca7006050621 100644 --- a/datafusion/core/src/physical_plan/planner.rs +++ b/datafusion/core/src/physical_plan/planner.rs @@ -2035,7 +2035,7 @@ mod tests { .build()?; let execution_plan = plan(&logical_plan).await?; // verify that the plan correctly adds cast from Int64(1) to Utf8, and the const will be evaluated. - let expected = "expr: [(InListExpr { expr: Column { name: \"c1\", index: 0 }, list: [Literal { value: Utf8(\"a\") }, Literal { value: Utf8(\"1\") }], negated: false, set: None }"; + let expected = "expr: [(BinaryExpr { left: BinaryExpr { left: Column { name: \"c1\", index: 0 }, op: Eq, right: Literal { value: Utf8(\"1\") } }, op: Or, right: BinaryExpr { left: Column { name: \"c1\", index: 0 }, op: Eq, right: Literal { value: Utf8(\"a\") } } }"; assert!(format!("{:?}", execution_plan).contains(expected)); Ok(()) diff --git a/datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs b/datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs index 50b367dd4eaa..00b0e0edc494 100644 --- a/datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs +++ b/datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs @@ -377,7 +377,7 @@ impl<'a, S: SimplifyInfo> ExprRewriter for Simplifier<'a, S> { expr, list, negated, - } if list.len() <= THRESHOLD_INLINE_INLIST => { + } if list.len() <= THRESHOLD_INLINE_INLIST && expr.try_into_col().is_ok() => { let first_val = list[0].clone(); if negated { list.into_iter()