morningman commented on a change in pull request #3694:
URL: https://github.com/apache/incubator-doris/pull/3694#discussion_r430969199



##########
File path: be/src/exec/olap_scan_node.cpp
##########
@@ -736,100 +735,114 @@ static bool ignore_cast(SlotDescriptor* slot, Expr* 
expr) {
     return false;
 }
 
+// Construct the ColumnValueRange for one specified column
+// It will only handle the InPredicate and eq BinaryPredicate in 
_conjunct_ctxs.
+// It will try to push down conditions of that column as much as possible,
+// But if the number of conditions exceeds the limit, none of conditions will 
be pushed down.
 template<class T>
-Status OlapScanNode::normalize_in_predicate(SlotDescriptor* slot, 
ColumnValueRange<T>* range) {
+Status OlapScanNode::normalize_in_and_eq_predicate(SlotDescriptor* slot, 
ColumnValueRange<T>* range) {
+    bool meet_eq_binary = false;
     for (int conj_idx = 0; conj_idx < _conjunct_ctxs.size(); ++conj_idx) {
         // 1. Normalize in conjuncts like 'where col in (v1, v2, v3)'
         if (TExprOpcode::FILTER_IN == _conjunct_ctxs[conj_idx]->root()->op()) {
             InPredicate* pred = 
dynamic_cast<InPredicate*>(_conjunct_ctxs[conj_idx]->root());
             if (pred->is_not_in()) {
+                // can not push down NOT IN predicate to storage engine
                 continue;
             }
 
             if (Expr::type_without_cast(pred->get_child(0)) != 
TExprNodeType::SLOT_REF) {
+                // not a slot ref(column)
+                continue;
+            }
+
+            std::vector<SlotId> slot_ids;
+            if (pred->get_child(0)->get_slot_ids(&slot_ids) != 1) {
+                // not a single column predicate
+                continue;
+            }

Review comment:
       I am not sure about that, looks like line `754` can guarantee.
   But just leave this judgement, because no matter what, we still have to call 
`get_slot_ids()` to get the slot id and check if it equals to the `slot->id()` 
later.




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



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

Reply via email to