liukun4515 commented on code in PR #3661:
URL: https://github.com/apache/arrow-datafusion/pull/3661#discussion_r984120625


##########
datafusion/optimizer/src/simplify_expressions.rs:
##########
@@ -863,28 +863,23 @@ impl<'a, S: SimplifyInfo> ExprRewriter for Simplifier<'a, 
S> {
             //
             // Rules for Between
             //
-            // TODO https://github.com/apache/arrow-datafusion/issues/3587
-            // we remove between optimization temporarily, and will recover it 
after above issue fixed.
-            // We should check compatibility for `expr` `low` and `high` expr 
first.
-            // The rule only can work, when these three exprs can be casted to 
a same data type.
 
             // a between 3 and 5  -->  a >= 3 AND a <=5
             // a not between 3 and 5  -->  a < 3 OR a > 5
-
-            // Between {
-            //     expr,
-            //     low,
-            //     high,
-            //     negated,
-            // } => {
-            //     if negated {
-            //         let l = *expr.clone();
-            //         let r = *expr;
-            //         or(l.lt(*low), r.gt(*high))
-            //     } else {
-            //         and(expr.clone().gt_eq(*low), expr.lt_eq(*high))
-            //     }
-            // }
+            Between {

Review Comment:
   In this https://github.com/apache/arrow-datafusion/pull/3396, I comment 
there optimization for between.
   
   Now the `type coercion` has been done before this rule, the data type must 
be compatible.
   
   If we meet the error when create the physical expr when evaluating the 
value, it must be error caused by `type coercion`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to