Lordworms commented on code in PR #10166:
URL: https://github.com/apache/datafusion/pull/10166#discussion_r1575279632


##########
datafusion/optimizer/src/filter_null_join_keys.rs:
##########
@@ -100,11 +105,18 @@ fn create_not_null_predicate(filters: Vec<Expr>) -> Expr {
         .into_iter()
         .map(|c| Expr::IsNotNull(Box::new(c)))
         .collect();
-    // combine the IsNotNull expressions with AND
+
+    // directly unwrap since it should always have a value
     not_null_exprs
-        .iter()
-        .skip(1)
-        .fold(not_null_exprs[0].clone(), |a, b| and(a, b.clone()))
+        .into_iter()
+        .reduce(|a, b| {
+            Expr::BinaryExpr(BinaryExpr {
+                left: Box::new(a),
+                op: Operator::And,
+                right: Box::new(b),
+            })
+        })
+        .unwrap()

Review Comment:
   Sure, I'll do this right now and try my best to finish most of the rest 
OptimizationRules this week



-- 
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: commits-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@datafusion.apache.org
For additional commands, e-mail: commits-h...@datafusion.apache.org

Reply via email to