liukun4515 commented on code in PR #3422:
URL: https://github.com/apache/arrow-datafusion/pull/3422#discussion_r968329166
##########
datafusion/core/src/physical_optimizer/pruning.rs:
##########
@@ -495,22 +500,30 @@ fn rewrite_expr_to_prunable(
}
match column_expr {
- // `col > lit()`
+ // col op lit()
Expr::Column(_) => Ok((column_expr.clone(), op, scalar_expr.clone())),
-
+ // `cast(col) op lit()`
+ Expr::Cast { expr, data_type } => {
+ let from_type = expr.get_type(&schema)?;
+ verify_support_type_for_prune(&from_type, data_type)?;
+ let (left, op, right) =
+ rewrite_expr_to_prunable(expr, op, scalar_expr, schema)?;
+ Ok((cast(left, data_type.clone()), op, right))
+ }
+ // `try_cast(col) op lit()`
+ Expr::TryCast { expr, data_type } => {
+ let from_type = expr.get_type(&schema)?;
+ verify_support_type_for_prune(&from_type, data_type)?;
+ let (left, op, right) =
+ rewrite_expr_to_prunable(expr, op, scalar_expr, schema)?;
+ Ok((try_cast(left, data_type.clone()), op, right))
+ }
+ // `col > lit()`
Review Comment:
Done
removed
--
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]