You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/12/13 09:29:57 UTC

[GitHub] [arrow] Dandandan commented on a change in pull request #8903: ARROW-9771: [Rust] [DataFusion] treat predicates separated by AND separately in predicate pushdown

Dandandan commented on a change in pull request #8903:
URL: https://github.com/apache/arrow/pull/8903#discussion_r541886004



##########
File path: rust/datafusion/src/optimizer/filter_push_down.rs
##########
@@ -215,13 +215,38 @@ fn issue_filters(
     push_down(&state, &plan)
 }
 
+/// converts "A AND B AND C" => [A, B, C]
+fn split_members(predicate: &Expr) -> Vec<&Expr> {
+    match predicate {
+        Expr::BinaryExpr {
+            right,
+            op: Operator::And,
+            left,
+        } => {
+            let mut a = split_members(&left);
+            a.extend(split_members(&right));

Review comment:
       I think this could be O(n*n) in complexity as expression trees are often nested like `1+(1+(1+(...` and extend just iterates over the right side.
   Probably requires a pretty big expression to become a problem, but still maybe something to think about?




----------------------------------------------------------------
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:
users@infra.apache.org