HappenLee commented on code in PR #9432:
URL: https://github.com/apache/incubator-doris/pull/9432#discussion_r867598416


##########
be/src/vec/common/hash_table/hash_table_proxy_for_multi_tables.h:
##########
@@ -0,0 +1,189 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include "hash_table.h"
+
+namespace doris::vectorized {
+
+/** HashTableProxyForMultiTables contains (1 << bits_for_tables_num) tables.
+  */
+template <typename TData, size_t bits_for_tables_num = 2>
+class HashTableProxyForMultiTables {
+public:
+    using Data = TData;
+    using Self = HashTableProxyForMultiTables;
+    using LookupResult = typename Data::LookupResult;
+    using key_type = typename Data::key_type;
+    using mapped_type = typename Data::mapped_type;
+    using value_type = typename Data::value_type;
+
+    static constexpr size_t tables_num = 1 << bits_for_tables_num;

Review Comment:
   use capital TABLES_NUM as a constexpr value



##########
be/src/vec/common/hash_table/hash_table_proxy_for_multi_tables.h:
##########
@@ -0,0 +1,189 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include "hash_table.h"
+
+namespace doris::vectorized {
+
+/** HashTableProxyForMultiTables contains (1 << bits_for_tables_num) tables.
+  */
+template <typename TData, size_t bits_for_tables_num = 2>
+class HashTableProxyForMultiTables {
+public:
+    using Data = TData;
+    using Self = HashTableProxyForMultiTables;
+    using LookupResult = typename Data::LookupResult;
+    using key_type = typename Data::key_type;
+    using mapped_type = typename Data::mapped_type;
+    using value_type = typename Data::value_type;
+
+    static constexpr size_t tables_num = 1 << bits_for_tables_num;
+    static constexpr size_t max_hash_value_shift = 
std::max(bits_for_tables_num, size_t(32));
+
+    HashTableProxyForMultiTables() { tail_table = &tables[tables_num - 1]; }
+
+private:
+    Data tables[tables_num];
+    Data* tail_table;
+
+    template <typename Derived, bool is_const>
+    class iterator_base {
+    public:
+        using it_type = std::conditional_t<is_const, typename 
Data::const_iterator,
+                                           typename Data::iterator>;
+
+    private:
+        using Container = std::conditional_t<is_const, const Self, Self>;
+
+        Container* container;

Review Comment:
    Container* _container; Use underscores on member variables
   
   



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