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


##########
be/src/vec/columns/column_struct.cpp:
##########
@@ -224,8 +224,8 @@ void 
ColumnStruct::update_crcs_with_value(std::vector<uint64_t>& hash, Primitive
     }
 }
 
-void ColumnStruct::insert_indices_from(const IColumn& src, const int* 
indices_begin,
-                                       const int* indices_end) {
+void ColumnStruct::insert_indices_from(const IColumn& src, const uint32_t* 
__restrict indices_begin,

Review Comment:
   warning: method 'insert_indices_from' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/vec/columns/column_struct.h:122:
   ```diff
   -     void insert_indices_from(const IColumn& src, const uint32* __restrict 
indices_begin,
   +     static void insert_indices_from(const IColumn& src, const uint32* 
__restrict indices_begin,
   ```
   



##########
be/src/vec/common/hash_table/hash_map.h:
##########
@@ -228,29 +231,118 @@
         }
     }
 
+    template <int JoinOpType>
     auto find_batch(const Key* __restrict keys, const size_t* __restrict 
hash_values, int probe_idx,
                     int probe_rows, std::vector<uint32_t>& probe_idxs,
-                    std::vector<int>& build_idxs) {
+                    std::vector<uint32_t>& build_idxs) {
+        if constexpr (JoinOpType == doris::TJoinOp::INNER_JOIN ||
+                      JoinOpType == doris::TJoinOp::LEFT_OUTER_JOIN) {
+            return _find_batch_inner_outer_join<JoinOpType>(keys, hash_values, 
probe_idx,
+                                                            probe_rows, 
probe_idxs, build_idxs);
+        }
+        if constexpr (JoinOpType == doris::TJoinOp::LEFT_ANTI_JOIN ||
+                      JoinOpType == doris::TJoinOp::LEFT_SEMI_JOIN) {
+            return _find_batch_left_semi_anti<JoinOpType>(keys, hash_values, 
probe_idx, probe_rows,
+                                                          probe_idxs);
+        }
+        return std::pair {0, 0};
+    }
+
+private:
+    template <int JoinOpType>
+    auto _find_batch_left_semi_anti(const Key* __restrict keys,
+                                    const size_t* __restrict hash_values, int 
probe_idx,
+                                    int probe_rows, std::vector<uint32_t>& 
probe_idxs) {
         auto matched_cnt = 0;
-        while (probe_idx < probe_rows && matched_cnt < 4096) {
+        const auto batch_size = max_batch_size;
+
+        while (LIKELY(probe_idx < probe_rows && matched_cnt < batch_size)) {

Review Comment:
   warning: boolean expression can be simplified by DeMorgan's theorem 
[readability-simplify-boolean-expr]
   ```cpp
           while (LIKELY(probe_idx < probe_rows && matched_cnt < batch_size)) {
                  ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/common/compiler_util.h:34:** expanded from macro 'LIKELY'
   ```cpp
   #define LIKELY(expr) __builtin_expect(!!(expr), 1)
                                          ^
   ```
   
   </details>
   



##########
be/src/vec/core/block.cpp:
##########
@@ -944,7 +944,8 @@ void MutableBlock::add_row(const Block* block, int row) {
     }
 }
 
-void MutableBlock::add_rows(const Block* block, const int* row_begin, const 
int* row_end) {
+void MutableBlock::add_rows(const Block* block, const uint32_t* row_begin,

Review Comment:
   warning: method 'add_rows' can be made const 
[readability-make-member-function-const]
   
   be/src/vec/core/block.h:594:
   ```diff
   -     void add_rows(const Block* block, const uint32_t* row_begin, const 
uint32_t* row_end);
   +     void add_rows(const Block* block, const uint32_t* row_begin, const 
uint32_t* row_end) const;
   ```
   
   be/src/vec/core/block.cpp:947:
   ```diff
   -                             const uint32_t* row_end) {
   +                             const uint32_t* row_end) const {
   ```
   



##########
be/src/vec/common/hash_table/hash_map.h:
##########
@@ -22,6 +22,7 @@
 
 #include <span>
 
+#include "gen_cpp/PlanNodes_types.h"

Review Comment:
   warning: 'gen_cpp/PlanNodes_types.h' file not found [clang-diagnostic-error]
   ```cpp
   #include "gen_cpp/PlanNodes_types.h"
            ^
   ```
   



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