26 #include <unordered_set>
43 std::pair<std::vector<const int32_t*>, std::vector<int32_t>>;
52 static std::shared_ptr<BaselineJoinHashTable>
getInstance(
53 const std::shared_ptr<Analyzer::BinOper> condition,
54 const std::vector<InputTableInfo>& query_infos,
58 const int device_count,
67 const Executor* executor,
68 const std::vector<InnerOuter>& inner_outer_pairs);
71 const int device_id = 0,
72 bool raw =
false)
const override;
75 const int device_id)
const override;
80 const size_t)
override;
113 auto candidate_table_keys =
115 if (candidate_table_keys.has_value()) {
118 *candidate_table_keys,
122 *candidate_table_keys,
143 const std::shared_ptr<Analyzer::BinOper> condition,
145 const std::vector<InputTableInfo>& query_infos,
149 const std::vector<InnerOuter>& inner_outer_pairs,
150 const std::vector<InnerOuterStringOpInfos>& col_pairs_string_op_infos,
151 const int device_count,
161 const std::vector<
InnerOuter>& inner_outer_pairs);
166 const std::vector<Fragmenter_Namespace::FragmentInfo>& fragments,
182 const std::vector<
InnerOuter>& inner_outer_pairs) const;
188 Data_Namespace::
DataMgr* data_mgr);
194 const logger::ThreadLocalIds parent_thread_local_ids);
201 const Data_Namespace::
MemoryLevel effective_memory_level,
203 const
int device_id);
214 std::shared_ptr<
HashTable> hashtable_ptr,
216 size_t hashtable_building_time);
221 const std::vector<Fragmenter_Namespace::FragmentInfo>& fragments) const;
236 auto inner_col = inner_outer.first;
238 auto outer_col = rhs_col_var ? rhs_col_var : inner_col;
239 boost::hash_combine(hash, inner_col->toString());
240 if (inner_col->get_type_info().is_string()) {
241 boost::hash_combine(hash, outer_col->toString());
248 boost::hash_combine(hash, info.
join_type);
267 std::optional<HashType>
Defines data structures for the semantic analysis phase of query processing.
bool needs_dict_translation_
size_t offsetBufferOff() const noexceptoverride
std::set< DecodedJoinHashBufferEntry > toSet(const ExecutorDeviceType device_type, const int device_id) const override
std::vector< int > ChunkKey
void putHashTableOnCpuToCache(QueryPlanHash key, CacheItemType item_type, std::shared_ptr< HashTable > hashtable_ptr, DeviceIdentifier device_identifier, size_t hashtable_building_time)
std::mutex str_proxy_translation_mutex_
std::vector< InnerOuterStringOpInfos > inner_outer_string_op_infos_pairs
std::string toString(const ExecutorDeviceType device_type, const int device_id=0, bool raw=false) const override
std::vector< QueryPlanHash > hashtable_cache_key_
std::pair< const Analyzer::ColumnVar *, const Analyzer::Expr * > InnerOuter
Data_Namespace::MemoryLevel getEffectiveMemoryLevel(const std::vector< InnerOuter > &inner_outer_pairs) const
HashJoinMatchingSet codegenMatchingSet(const CompilationOptions &, const size_t) override
const size_t num_elements
HashTableBuildDagMap hashtable_build_dag_map_
size_t getKeyBufferSize() const noexcept
const TableIdToNodeMap table_id_to_node_map_
size_t getComponentBufferSize() const noexceptoverride
RegisteredQueryHint query_hints_
int getInnerTableRteIdx() const noexceptoverride
std::unordered_set< size_t > table_keys_
const JoinType join_type_
virtual ColumnsForDevice fetchColumnsForDevice(const std::vector< Fragmenter_Namespace::FragmentInfo > &fragments, const int device_id, DeviceAllocator *dev_buff_owner)
virtual int initHashTableForDevice(const std::vector< JoinColumn > &join_columns, const std::vector< JoinColumnTypeInfo > &join_column_types, const std::vector< JoinBucketInfo > &join_buckets, const HashType layout, const Data_Namespace::MemoryLevel effective_memory_level, const BaselineHashTableEntryInfo hash_table_entry_info, const int device_id)
const std::vector< InputTableInfo > & query_infos_
virtual llvm::Value * codegenKey(const CompilationOptions &)
std::shared_ptr< HashTable > initHashTableOnCpuFromCache(QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier)
size_t payloadBufferOff() const noexceptoverride
std::vector< InnerOuter > inner_outer_pairs_
virtual ~BaselineJoinHashTable()
void reify(const HashType preferred_layout)
std::unordered_map< size_t, HashTableBuildDag > HashTableBuildDagMap
HashType getHashType() const noexceptoverride
static QueryPlanHash getAlternativeCacheKey(AlternativeCacheKeyForBaselineHashJoin &info)
std::vector< InnerOuterStringOpInfos > inner_outer_string_op_infos_pairs_
static std::unique_ptr< HashtableRecycler > hash_table_cache_
ColumnCacheMap & column_cache_
size_t shardCount() const
std::string getHashJoinType() const final
Data_Namespace::MemoryLevel getMemoryLevel() const noexceptoverride
BaselineJoinHashTable(const std::shared_ptr< Analyzer::BinOper > condition, const JoinType join_type, const std::vector< InputTableInfo > &query_infos, const Data_Namespace::MemoryLevel memory_level, ColumnCacheMap &column_cache, Executor *executor, const std::vector< InnerOuter > &inner_outer_pairs, const std::vector< InnerOuterStringOpInfos > &col_pairs_string_op_infos, const int device_count, const RegisteredQueryHint &query_hints, const HashTableBuildDagMap &hashtable_build_dag_map, const TableIdToNodeMap &table_id_to_node_map)
virtual std::pair< size_t, size_t > approximateTupleCount(const std::vector< ColumnsForDevice > &) const
HashtableCacheMetaInfo hashtable_cache_meta_info_
virtual void reifyWithLayout(const HashType layout)
Executor(const ExecutorId id, Data_Namespace::DataMgr *data_mgr, const size_t block_size_x, const size_t grid_size_x, const size_t max_gpu_slab_size, const std::string &debug_dir, const std::string &debug_file)
std::unordered_map< shared::TableKey, const RelAlgNode * > TableIdToNodeMap
std::pair< std::vector< const int32_t * >, std::vector< int32_t >> StrProxyTranslationMapsPtrsAndOffsets
static HashingSchemeRecycler * getHashingSchemeCache()
std::optional< HashType > layout_override_
virtual void reifyForDevice(const ColumnsForDevice &columns_for_device, const HashType layout, const int device_id, const BaselineHashTableEntryInfo hash_table_entry_info, const logger::ThreadLocalIds parent_thread_local_ids)
static std::shared_ptr< BaselineJoinHashTable > getInstance(const std::shared_ptr< Analyzer::BinOper > condition, const std::vector< InputTableInfo > &query_infos, const Data_Namespace::MemoryLevel memory_level, const JoinType join_type, const HashType preferred_hash_type, const int device_count, ColumnCacheMap &column_cache, Executor *executor, const HashTableBuildDagMap &hashtable_build_dag_map, const RegisteredQueryHint &query_hints, const TableIdToNodeMap &table_id_to_node_map)
Make hash table from an in-flight SQL query's parse tree etc.
std::unordered_map< shared::TableKey, std::unordered_map< int, std::shared_ptr< const ColumnarResults >>> ColumnCacheMap
const Data_Namespace::MemoryLevel memory_level_
static void invalidateCache()
llvm::Value * hashPtr(const size_t index)
std::size_t hash_value(RexAbstractInput const &rex_ab_input)
const RegisteredQueryHint & getRegisteredQueryHint()
llvm::Value * codegenSlot(const CompilationOptions &, const size_t) override
bool isBitwiseEq() const override
static HashtableRecycler * getHashTableCache()
static void markCachedItemAsDirty(size_t table_key)
virtual size_t getKeyComponentCount() const
void copyCpuHashTableToGpu(std::shared_ptr< BaselineHashTable > &cpu_hash_table, const int device_id, Data_Namespace::DataMgr *data_mgr)
ChunkKey genChunkKey(const std::vector< Fragmenter_Namespace::FragmentInfo > &fragments) const
std::vector< const StringDictionaryProxy::IdMap * > str_proxy_translation_maps_
virtual size_t getKeyComponentWidth() const
std::mutex cpu_hash_table_buff_mutex_
static size_t getShardCountForCondition(const Analyzer::BinOper *condition, const Executor *executor, const std::vector< InnerOuter > &inner_outer_pairs)
static std::unique_ptr< HashingSchemeRecycler > hash_table_layout_cache_
static constexpr DeviceIdentifier CPU_DEVICE_IDENTIFIER
int getDeviceCount() const noexceptoverride
shared::TableKey getInnerTableId() const noexceptoverride
const std::shared_ptr< Analyzer::BinOper > condition_
std::vector< InnerOuter > inner_outer_pairs
size_t countBufferOff() const noexceptoverride