From 139f08d665c6fa20de43d51cbde1f5ac5bb82cb9 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 6 Oct 2022 08:59:22 -0400 Subject: [PATCH] Further simplify --- datafusion/optimizer/src/unwrap_cast_in_comparison.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/datafusion/optimizer/src/unwrap_cast_in_comparison.rs b/datafusion/optimizer/src/unwrap_cast_in_comparison.rs index 2d8ac33c512d..8392e28a913d 100644 --- a/datafusion/optimizer/src/unwrap_cast_in_comparison.rs +++ b/datafusion/optimizer/src/unwrap_cast_in_comparison.rs @@ -155,11 +155,9 @@ impl ExprRewriter for UnwrapCastExprRewriter { Expr::BinaryExpr { left, op, right } => { let left = left.as_ref().clone(); let right = right.as_ref().clone(); - let left_type = left.get_type(&self.schema); - let right_type = right.get_type(&self.schema); + let left_type = left.get_type(&self.schema)?; + let right_type = right.get_type(&self.schema)?; // Because the plan has been done the type coercion, the left and right must be equal - let left_type = left_type?; - let right_type = right_type?; if is_support_data_type(&left_type) && is_support_data_type(&right_type) && is_comparison_op(op)