seddonm1 commented on a change in pull request #8865:
URL: https://github.com/apache/arrow/pull/8865#discussion_r539654237
##########
File path: rust/datafusion/src/optimizer/utils.rs
##########
@@ -370,6 +385,27 @@ pub fn rewrite_expression(expr: &Expr, expressions:
&Vec<Expr>) -> Result<Expr>
asc: asc.clone(),
nulls_first: nulls_first.clone(),
}),
+ Expr::Between { negated, .. } => {
+ let expr = Expr::BinaryExpr {
+ left: Box::new(Expr::BinaryExpr {
+ left: Box::new(expressions[0].clone()),
+ op: Operator::GtEq,
+ right: Box::new(expressions[1].clone()),
+ }),
+ op: Operator::And,
+ right: Box::new(Expr::BinaryExpr {
+ left: Box::new(expressions[0].clone()),
+ op: Operator::LtEq,
+ right: Box::new(expressions[2].clone()),
+ }),
+ };
+
+ if *negated {
+ Ok(Expr::Not(Box::new(expr)))
Review comment:
so would you like to make changes? I'm happy to implement whatever
decision you make.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]