imay commented on a change in pull request #3277: [Doris on es] Support 
compound_and predicate push down to Elasticsearch
URL: https://github.com/apache/incubator-doris/pull/3277#discussion_r405250902
 
 

 ##########
 File path: be/src/exec/es/es_predicate.cpp
 ##########
 @@ -384,10 +390,27 @@ Status EsPredicate::build_disjuncts_list(const Expr* 
conjunct) {
         _disjuncts.push_back(predicate);
 
         return Status::OK();
-    } 
-    
+    }
     if (TExprNodeType::COMPOUND_PRED == conjunct->node_type()) {
         if (TExprOpcode::COMPOUND_OR != conjunct->op()) {
+            // processe COMPOUND_AND, such as:
+            // k = 1 or (k1 = 7 and (k2 in (6,7) or k3 = 12))
+            // k1 = 7 and (k2 in (6,7) or k3 = 12) is compound pred, we should 
rebuild this sub tree
+            if (TExprOpcode::COMPOUND_AND == conjunct->op()) {
 
 Review comment:
   There are three possibilities here. AND, OR, NOT, For me, `NOT` can be 
supported too.
   And you can do as follow
   
   ```
   if (conjunct->op() == AND)
   else if (conjunct->op() == NOT)
   
   DCHECK(op() == OR)
   // handle OR
   ```

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


With regards,
Apache Git Services

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

Reply via email to