alamb commented on code in PR #12978:
URL: https://github.com/apache/datafusion/pull/12978#discussion_r1805340333


##########
datafusion/core/src/physical_optimizer/pruning.rs:
##########
@@ -1487,6 +1489,17 @@ fn build_predicate_expression(
                 *bin_expr.op(),
                 bin_expr.right().clone(),
             )
+        } else if let Some(like_expr) = 
expr_any.downcast_ref::<phys_expr::LikeExpr>() {
+            if like_expr.case_insensitive() {
+                return unhandled_hook.handle(expr);
+            }
+            let op = match (like_expr.negated(), like_expr.case_insensitive()) 
{
+                (false, false) => Operator::LikeMatch,
+                (true, false) => Operator::NotLikeMatch,
+                (false, true) => Operator::ILikeMatch,
+                (true, true) => Operator::NotILikeMatch,

Review Comment:
   I think this is dead code as `if like_expr.case_insensitive() {` catches the 
case insensitive case
   
   I think this code would be clearer if it just matched on 
`like_expr.negated()` (or alternately returned `unhandled_hook.handle(expr);` 
directly for these last 2 cases



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to