yiguolei commented on code in PR #14383: URL: https://github.com/apache/doris/pull/14383#discussion_r1025946375
########## be/src/vec/runtime/shared_hash_table_controller.h: ########## @@ -37,33 +38,170 @@ namespace vectorized { class VExprContext; +template <typename RowRefListType> +struct SerializedHashTableContext { + using Mapped = RowRefListType; + using HashTable = HashMap<StringRef, Mapped>; + using HashTablePtr = std::shared_ptr<HashMap<StringRef, Mapped>>; + using State = ColumnsHashing::HashMethodSerialized<typename HashTable::value_type, Mapped>; + using Iter = typename HashTable::iterator; + + HashTable hash_table; + Iter iter; + bool inited = false; + + void init_once() { + if (!inited) { + inited = true; + iter = hash_table.begin(); + } + } +}; + +template <typename HashMethod> +struct IsSerializedHashTableContextTraits { + constexpr static bool value = false; +}; + +template <typename Value, typename Mapped> +struct IsSerializedHashTableContextTraits<ColumnsHashing::HashMethodSerialized<Value, Mapped>> { + constexpr static bool value = true; +}; + +// T should be UInt32 UInt64 UInt128 +template <class T, typename RowRefListType> +struct PrimaryTypeHashTableContext { + using Mapped = RowRefListType; + using HashTable = HashMap<T, Mapped, HashCRC32<T>>; + using HashTablePtr = std::shared_ptr<HashMap<T, Mapped, HashCRC32<T>>>; Review Comment: HashTableSPtr -- 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