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


##########
be/src/vec/exec/vsort_node.cpp:
##########
@@ -81,6 +58,30 @@ Status VSortNode::init(const TPlanNode& tnode, RuntimeState* 
state) {
         _sorter.reset(new FullSorter(_vsort_exec_exprs, _limit, _offset, 
_pool, _is_asc_order,
                                      _nulls_first, row_desc, state, 
_runtime_profile.get()));
     }
+    // init runtime predicate
+    _use_topn_opt = tnode.sort_node.use_topn_opt;
+    if (_use_topn_opt) {
+        auto query_ctx = state->get_query_fragments_ctx();
+        auto first_sort_expr_node = 
tnode.sort_node.sort_info.ordering_exprs[0].nodes[0];
+        if (first_sort_expr_node.node_type == TExprNodeType::SLOT_REF) {
+            auto first_sort_slot = first_sort_expr_node.slot_ref;
+            for (auto tuple_desc : this->row_desc().tuple_descriptors()) {
+                if (tuple_desc->id() != first_sort_slot.tuple_id) {
+                    continue;
+                }
+                for (auto slot : tuple_desc->slots()) {
+                    if (slot->id() == first_sort_slot.slot_id) {
+                        
RETURN_IF_ERROR(query_ctx->get_runtime_predicate().init(slot->type().type,

Review Comment:
   warning: too many arguments to function call, expected 1, have 2; did you 
mean 'config::init'? [clang-diagnostic-error]
   
   ```suggestion
                           
RETURN_IF_ERROR(query_ctx->get_runtime_predicate().config::init(slot->type().type,
   ```
   **be/src/common/status.h:507:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           Status _status_ = (stmt);       \
                              ^
   ```
   **be/src/common/configbase.h:173:** 'config::init' declared here
   ```cpp
   bool init(const char* conf_file, bool fill_conf_map = false, bool must_exist 
= true,
        ^
   ```
   



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

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


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

Reply via email to