github-actions[bot] commented on code in PR #15967:
URL: https://github.com/apache/doris/pull/15967#discussion_r1070935014
##########
be/src/vec/common/hash_table/partitioned_hash_map.h:
##########
@@ -46,8 +46,34 @@
return *lookup_result_get_mapped(it);
}
+
+ template <typename Func>
+ void for_each_mapped(Func&& func) {
+ for (auto& v : *this) {
+ func(v.get_second());
+ }
+ }
};
template <typename Key, typename Mapped, typename Hash = DefaultHash<Key>>
using PartitionedHashMap =
PartitionedHashMapTable<HashMap<Key, Mapped, Hash,
PartitionedHashTableGrower<>>>;
+
+template <typename Key, typename Mapped, typename Hash = DefaultHash<Key>>
+using PHPartitionedHashMap = PartitionedHashMapTable<PHHashMap<Key, Mapped,
Hash>>;
+
+template <typename Key, typename Mapped, typename Hash>
+struct HashTableTraits<PHPartitionedHashMap<Key, Mapped, Hash>> {
Review Comment:
warning: no template named 'HashTableTraits'; did you mean
'HashTableGrower'? [clang-diagnostic-error]
```suggestion
struct HashTableGrower<PHPartitionedHashMap<Key, Mapped, Hash>> {
```
**be/src/vec/common/hash_table/hash_table.h:243:** 'HashTableGrower'
declared here
```cpp
struct HashTableGrower {
^
```
##########
be/src/vec/common/hash_table/partitioned_hash_map.h:
##########
@@ -46,8 +46,34 @@
return *lookup_result_get_mapped(it);
}
+
+ template <typename Func>
+ void for_each_mapped(Func&& func) {
+ for (auto& v : *this) {
+ func(v.get_second());
+ }
+ }
};
template <typename Key, typename Mapped, typename Hash = DefaultHash<Key>>
using PartitionedHashMap =
PartitionedHashMapTable<HashMap<Key, Mapped, Hash,
PartitionedHashTableGrower<>>>;
+
+template <typename Key, typename Mapped, typename Hash = DefaultHash<Key>>
+using PHPartitionedHashMap = PartitionedHashMapTable<PHHashMap<Key, Mapped,
Hash>>;
+
+template <typename Key, typename Mapped, typename Hash>
+struct HashTableTraits<PHPartitionedHashMap<Key, Mapped, Hash>> {
Review Comment:
warning: use of undeclared identifier 'PHPartitionedHashMap'
[clang-diagnostic-error]
```cpp
struct HashTableTraits<PHPartitionedHashMap<Key, Mapped, Hash>> {
^
```
##########
be/src/vec/common/hash_table/partitioned_hash_map.h:
##########
@@ -46,8 +46,34 @@ class PartitionedHashMapTable : public
PartitionedHashTable<ImplTable> {
return *lookup_result_get_mapped(it);
}
+
+ template <typename Func>
+ void for_each_mapped(Func&& func) {
+ for (auto& v : *this) {
+ func(v.get_second());
+ }
+ }
};
template <typename Key, typename Mapped, typename Hash = DefaultHash<Key>>
using PartitionedHashMap =
PartitionedHashMapTable<HashMap<Key, Mapped, Hash,
PartitionedHashTableGrower<>>>;
+
+template <typename Key, typename Mapped, typename Hash = DefaultHash<Key>>
+using PHPartitionedHashMap = PartitionedHashMapTable<PHHashMap<Key, Mapped,
Hash>>;
Review Comment:
warning: use of undeclared identifier 'PHHashMap' [clang-diagnostic-error]
```cpp
using PHPartitionedHashMap = PartitionedHashMapTable<PHHashMap<Key, Mapped,
Hash>>;
^
```
##########
be/src/vec/common/hash_table/partitioned_hash_map.h:
##########
@@ -46,8 +46,34 @@
return *lookup_result_get_mapped(it);
}
+
+ template <typename Func>
+ void for_each_mapped(Func&& func) {
+ for (auto& v : *this) {
+ func(v.get_second());
+ }
+ }
};
template <typename Key, typename Mapped, typename Hash = DefaultHash<Key>>
using PartitionedHashMap =
PartitionedHashMapTable<HashMap<Key, Mapped, Hash,
PartitionedHashTableGrower<>>>;
+
+template <typename Key, typename Mapped, typename Hash = DefaultHash<Key>>
+using PHPartitionedHashMap = PartitionedHashMapTable<PHHashMap<Key, Mapped,
Hash>>;
+
+template <typename Key, typename Mapped, typename Hash>
+struct HashTableTraits<PHPartitionedHashMap<Key, Mapped, Hash>> {
+ static constexpr bool is_phmap = true;
+ static constexpr bool is_parallel_phmap = false;
+ static constexpr bool is_string_hash_table = false;
+ static constexpr bool is_partitioned_table = true;
+};
+
+template <template <typename> class Derived, typename Key, typename Mapped,
typename Hash>
+struct HashTableTraits<Derived<PHPartitionedHashMap<Key, Mapped, Hash>>> {
Review Comment:
warning: use of undeclared identifier 'PHPartitionedHashMap'
[clang-diagnostic-error]
```cpp
struct HashTableTraits<Derived<PHPartitionedHashMap<Key, Mapped, Hash>>> {
^
```
##########
be/src/vec/common/hash_table/partitioned_hash_map.h:
##########
@@ -46,8 +46,34 @@
return *lookup_result_get_mapped(it);
}
+
+ template <typename Func>
+ void for_each_mapped(Func&& func) {
+ for (auto& v : *this) {
+ func(v.get_second());
+ }
+ }
};
template <typename Key, typename Mapped, typename Hash = DefaultHash<Key>>
using PartitionedHashMap =
PartitionedHashMapTable<HashMap<Key, Mapped, Hash,
PartitionedHashTableGrower<>>>;
+
+template <typename Key, typename Mapped, typename Hash = DefaultHash<Key>>
+using PHPartitionedHashMap = PartitionedHashMapTable<PHHashMap<Key, Mapped,
Hash>>;
+
+template <typename Key, typename Mapped, typename Hash>
+struct HashTableTraits<PHPartitionedHashMap<Key, Mapped, Hash>> {
+ static constexpr bool is_phmap = true;
+ static constexpr bool is_parallel_phmap = false;
+ static constexpr bool is_string_hash_table = false;
+ static constexpr bool is_partitioned_table = true;
+};
+
+template <template <typename> class Derived, typename Key, typename Mapped,
typename Hash>
+struct HashTableTraits<Derived<PHPartitionedHashMap<Key, Mapped, Hash>>> {
Review Comment:
warning: no template named 'HashTableTraits'; did you mean
'HashTableGrower'? [clang-diagnostic-error]
```suggestion
struct HashTableGrower<Derived<PHPartitionedHashMap<Key, Mapped, Hash>>> {
```
**be/src/vec/common/hash_table/hash_table.h:243:** 'HashTableGrower'
declared here
```cpp
struct HashTableGrower {
^
```
##########
be/src/vec/common/hash_table/partitioned_hash_table.h:
##########
@@ -398,6 +401,17 @@
}
}
+ void ALWAYS_INLINE prefetch_by_hash(size_t hash_value) {
+ if constexpr (HashTableTraits<Impl>::is_phmap) {
Review Comment:
warning: template argument for non-type template parameter must be an
expression [clang-diagnostic-error]
```cpp
if constexpr (HashTableTraits<Impl>::is_phmap) {
^
```
**be/src/vec/common/hash_table/hash_table.h:242:** template parameter is
declared here
```cpp
template <size_t initial_size_degree = 10>
^
```
##########
be/src/vec/common/hash_table/partitioned_hash_table.h:
##########
@@ -517,17 +559,26 @@
auto it = level0_sub_table.begin();
- /// It is assumed that the zero key (stored separately) is first in
iteration order.
- if (it != level0_sub_table.end() &&
it.get_ptr()->is_zero(level0_sub_table)) {
- insert(it->get_value());
- ++it;
- }
+ if constexpr (HashTableTraits<Impl>::is_phmap) {
Review Comment:
warning: no template named 'HashTableTraits'; did you mean
'HashTableGrower'? [clang-diagnostic-error]
```suggestion
if constexpr (HashTableGrower<Impl>::is_phmap) {
```
**be/src/vec/common/hash_table/hash_table.h:243:** 'HashTableGrower'
declared here
```cpp
struct HashTableGrower {
^
```
##########
be/src/vec/common/hash_table/partitioned_hash_table.h:
##########
@@ -398,6 +401,17 @@ class PartitionedHashTable : private boost::noncopyable,
Impl::Hash {
}
}
+ void ALWAYS_INLINE prefetch_by_hash(size_t hash_value) {
+ if constexpr (HashTableTraits<Impl>::is_phmap) {
Review Comment:
warning: no template named 'HashTableTraits'; did you mean
'HashTableGrower'? [clang-diagnostic-error]
```suggestion
if constexpr (HashTableGrower<Impl>::is_phmap) {
```
**be/src/vec/common/hash_table/hash_table.h:243:** 'HashTableGrower'
declared here
```cpp
struct HashTableGrower {
^
```
##########
be/src/vec/common/hash_table/partitioned_hash_table.h:
##########
@@ -517,17 +559,26 @@
auto it = level0_sub_table.begin();
- /// It is assumed that the zero key (stored separately) is first in
iteration order.
- if (it != level0_sub_table.end() &&
it.get_ptr()->is_zero(level0_sub_table)) {
- insert(it->get_value());
- ++it;
- }
+ if constexpr (HashTableTraits<Impl>::is_phmap) {
Review Comment:
warning: template argument for non-type template parameter must be an
expression [clang-diagnostic-error]
```cpp
if constexpr (HashTableTraits<Impl>::is_phmap) {
^
```
**be/src/vec/common/hash_table/hash_table.h:242:** template parameter is
declared here
```cpp
template <size_t initial_size_degree = 10>
^
```
##########
be/src/vec/common/hash_table/ph_hash_map.h:
##########
@@ -27,11 +27,13 @@ ALWAYS_INLINE inline auto
lookup_result_get_mapped(std::pair<const Key, Mapped>*
return &(it->second);
}
-template <typename Key, typename Mapped, typename Hash = DefaultHash<Key>,
+template <typename Key, typename Mapped, typename HashMethod =
DefaultHash<Key>,
bool use_parallel = false>
class PHHashMap : private boost::noncopyable {
Review Comment:
warning: expected class name [clang-diagnostic-error]
```cpp
class PHHashMap : private boost::noncopyable {
^
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]