Skip to content

Commit

Permalink
Tweak
Browse files Browse the repository at this point in the history
Tweak
  • Loading branch information
Dandandan committed Nov 3, 2022
1 parent fb57849 commit 942cb17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion datafusion/core/src/physical_plan/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 942cb17

Please sign in to comment.