You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2023/01/05 06:51:42 UTC

[GitHub] [doris] github-actions[bot] commented on a diff in pull request #15642: [Enhancement](topn) support two phase read for topn query

github-actions[bot] commented on code in PR #15642:
URL: https://github.com/apache/doris/pull/15642#discussion_r1062156640


##########
be/src/vec/exec/scan/new_olap_scan_node.cpp:
##########
@@ -179,13 +264,46 @@ static std::string tablets_id_to_string(
     return ss.str();
 }
 
+// iterate through conjuncts tree
+void NewOlapScanNode::_iterate_conjuncts_tree(const VExpr* conjunct_expr_root,
+                                              std::function<void(const VExpr*)> fn) {
+    if (!conjunct_expr_root) {
+        return;
+    }
+    fn(conjunct_expr_root);
+    for (const VExpr* child : conjunct_expr_root->children()) {
+        _iterate_conjuncts_tree(child, fn);
+    }
+    return;
+}

Review Comment:
   warning: redundant return statement at the end of a function with a void return type [readability-redundant-control-flow]
   
   ```suggestion
       }
   ```
   



##########
be/src/vec/exec/scan/new_olap_scan_node.cpp:
##########
@@ -179,13 +264,46 @@
     return ss.str();
 }
 
+// iterate through conjuncts tree
+void NewOlapScanNode::_iterate_conjuncts_tree(const VExpr* conjunct_expr_root,
+                                              std::function<void(const VExpr*)> fn) {
+    if (!conjunct_expr_root) {
+        return;
+    }
+    fn(conjunct_expr_root);
+    for (const VExpr* child : conjunct_expr_root->children()) {
+        _iterate_conjuncts_tree(child, fn);
+    }
+    return;
+}
+
+// get all slot ref column unique ids
+void NewOlapScanNode::_collect_conjuncts_slot_column_unique_ids(const VExpr* expr) {
+    if (!expr->is_slot_ref()) {
+        return;
+    }
+    auto slot_ref = reinterpret_cast<const VSlotRef*>(expr);
+    for (const auto* slot_desc : _output_tuple_desc->slots()) {
+        if (slot_desc->id() == slot_ref->slot_id() && slot_desc->col_unique_id() > 0) {
+            _conjuct_column_unique_ids.emplace(slot_desc->col_unique_id());
+        }
+    }
+    return;
+}

Review Comment:
   warning: redundant return statement at the end of a function with a void return type [readability-redundant-control-flow]
   
   ```suggestion
       }
   ```
   



-- 
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-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org