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


##########
be/src/vec/columns/column_struct.cpp:
##########
@@ -233,6 +233,15 @@ void ColumnStruct::insert_indices_from(const IColumn& src, 
const int* indices_be
     }
 }
 
+void ColumnStruct::insert_indices_from_join(const IColumn& src, const 
uint32_t* indices_begin,

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



##########
be/src/vec/common/hash_table/hash_map.h:
##########
@@ -193,10 +195,160 @@ class HashMapTable : public HashTable<Key, Cell, Hash, 
Grower, Allocator> {
     bool has_null_key_data() const { return false; }
 };
 
+template <typename Key, typename Cell, typename Hash = DefaultHash<Key>,
+          typename Grower = HashTableGrower<>, typename Allocator = 
HashTableAllocator>
+class JoinHashMapTable : public HashMapTable<Key, Cell, Hash, Grower, 
Allocator> {
+public:
+    using Self = JoinHashMapTable;
+    using Base = HashMapTable<Key, Cell, Hash, Grower, Allocator>;
+
+    using key_type = Key;
+    using value_type = typename Cell::value_type;
+    using mapped_type = typename Cell::Mapped;
+
+    using LookupResult = typename Base::LookupResult;
+
+    using HashMapTable<Key, Cell, Hash, Grower, Allocator>::HashMapTable;
+
+    static uint32_t calc_bucket_size(size_t num_elem) {
+        size_t expect_bucket_size = static_cast<size_t>(num_elem) + (num_elem 
- 1) / 7;

Review Comment:
   warning: 7 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
           size_t expect_bucket_size = static_cast<size_t>(num_elem) + 
(num_elem - 1) / 7;
                                                                                
        ^
   ```
   



##########
be/src/vec/columns/column_array.cpp:
##########
@@ -804,6 +804,17 @@ void ColumnArray::insert_indices_from(const IColumn& src, 
const int* indices_beg
     }
 }
 
+void ColumnArray::insert_indices_from_join(const IColumn& src, const uint32_t* 
indices_begin,
+                                           const uint32_t* indices_end) {
+    for (auto x = indices_begin; x != indices_end; ++x) {

Review Comment:
   warning: 'auto x' can be declared as 'const auto *x' 
[readability-qualified-auto]
   
   ```suggestion
       for (const auto *x = indices_begin; x != indices_end; ++x) {
   ```
   



##########
be/src/vec/columns/column_map.cpp:
##########
@@ -196,6 +196,17 @@ void ColumnMap::insert_indices_from(const IColumn& src, 
const int* indices_begin
     }
 }
 
+void ColumnMap::insert_indices_from_join(const IColumn& src, const uint32_t* 
indices_begin,
+                                         const uint32_t* indices_end) {
+    for (auto x = indices_begin; x != indices_end; ++x) {

Review Comment:
   warning: 'auto x' can be declared as 'const auto *x' 
[readability-qualified-auto]
   
   ```suggestion
       for (const auto *x = indices_begin; x != indices_end; ++x) {
   ```
   



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