72 const std::shared_ptr<Analyzer::BinOper> condition,
74 const std::vector<InputTableInfo>& query_infos,
77 const int device_count,
85 auto range_expr_col_var =
87 if (!range_expr_col_var || !range_expr_col_var->get_type_info().is_geometry()) {
88 throw HashJoinFail(
"Could not build hash tables for range join | " +
92 CHECK(range_expr_col_var->get_type_info().is_geometry());
94 auto coords_column_key = range_expr_col_var->getColumnKey();
95 coords_column_key.column_id = coords_column_key.column_id + 1;
99 auto range_join_inner_col_expr = makeExpr<Analyzer::ColumnVar>(
100 coords_cd->columnType, coords_column_key, range_expr_col_var->get_rte_idx());
102 std::vector<InnerOuter> inner_outer_pairs;
103 inner_outer_pairs.emplace_back(
105 condition->get_left_operand()});
107 const auto& query_info =
118 condition.get(), executor, inner_outer_pairs)
121 auto join_hash_table = std::make_shared<RangeJoinHashTable>(condition,
124 range_join_inner_col_expr,
132 hashtable_build_dag_map,
133 table_id_to_node_map);
139 throw HashJoinFail(std::string(
"Could not build a 1-to-1 correspondence for columns "
140 "involved in equijoin | ") +
143 throw HashJoinFail(std::string(
"Could not build hash tables for equijoin | ") +
147 }
catch (
const std::exception& e) {
148 LOG(
FATAL) <<
"Fatal error while attempting to build hash tables for join: "
152 return join_hash_table;
159 const auto& query_info =
163 if (query_info.fragments.empty()) {
170 std::vector<ColumnsForDevice> columns_per_device;
173 std::vector<std::vector<Fragmenter_Namespace::FragmentInfo>> fragments_per_device;
174 std::vector<std::unique_ptr<CudaAllocator>> dev_buff_owners;
176 for (
int device_id = 0; device_id <
device_count_; ++device_id) {
177 fragments_per_device.emplace_back(
180 : query_info.fragments);
182 dev_buff_owners.emplace_back(std::make_unique<CudaAllocator>(
188 const auto columns_for_device =
192 ? dev_buff_owners[device_id].
get()
194 columns_per_device.push_back(columns_for_device);
199 const auto bucket_range =
203 CHECK(bucket_range->get_type_info().is_fp() &&
204 bucket_range->get_type_info().get_size() == 8);
206 const auto bucket_range_datum = bucket_range->get_constval();
220 std::vector<InnerOuter> inner_outer_pairs_for_cache_lookup;
221 inner_outer_pairs_for_cache_lookup.emplace_back(
InnerOuter{
224 auto hashtable_access_path_info =
232 fragments_per_device,
235 table_keys_ = hashtable_access_path_info.table_keys;
237 auto get_inner_table_key = [&inner_outer_pairs_for_cache_lookup]() {
238 auto col_var = inner_outer_pairs_for_cache_lookup.front().first;
239 return col_var->getTableKey();
243 const auto& inner_table_key = get_inner_table_key();
254 fragments_per_device,
258 get_inner_table_key().table_id > 0) {
259 std::vector<size_t> per_device_chunk_key;
260 for (
int device_id = 0; device_id <
device_count_; ++device_id) {
262 boost::hash_combine(chunk_key_hash,
264 per_device_chunk_key.push_back(chunk_key_hash);
266 inner_outer_pairs_for_cache_lookup,
267 columns_per_device.front().join_columns.front().num_elems,
281 if (
auto generic_hash_table =
285 if (
auto hash_table =
286 std::dynamic_pointer_cast<BaselineHashTable>(generic_hash_table)) {
297 for (
int device_id = 0; device_id <
device_count_; ++device_id) {
298 auto gpu_hash_table = copyCpuHashTableToGpu(hash_table, device_id);
316 auto [entry_count, emitted_keys_count] =
322 VLOG(1) <<
"Finalized range join hash table: entry count " << entry_count
323 <<
" hash table size " << hash_table_size;
325 std::vector<std::future<void>> init_threads;
326 for (
int device_id = 0; device_id <
device_count_; ++device_id) {
327 init_threads.push_back(
331 columns_per_device[device_id],
338 for (
auto& init_thread : init_threads) {
341 for (
auto& init_thread : init_threads) {
349 const size_t entry_count,
350 const size_t emitted_keys_count,
365 VLOG(1) <<
"Building range join hash table on CPU.";
369 hash_table_entry_info);
374 auto gpu_hash_table = copyCpuHashTableToGpu(hash_table, device_id);
388 auto hash_table = initHashTableOnGpu(columns_for_device.
join_columns,
391 hash_table_entry_info,
403 std::shared_ptr<BaselineHashTable> RangeJoinHashTable::initHashTableOnGpu(
404 const std::vector<JoinColumn>& join_columns,
405 const std::vector<JoinColumnTypeInfo>& join_column_types,
406 const std::vector<JoinBucketInfo>& join_bucket_info,
408 const size_t device_id) {
411 VLOG(1) <<
"Building range join hash table on GPU.";
419 CHECK(!join_bucket_info.empty());
421 auto& inverse_bucket_sizes_for_dimension =
422 join_bucket_info[0].inverse_bucket_sizes_for_dimension;
425 inverse_bucket_sizes_for_dimension, allocator);
428 inverse_bucket_sizes_for_dimension.size(),
435 hash_table_entry_info,
441 std::string(
"Unrecognized error when initializing GPU range join hash table (") +
449 const std::vector<JoinColumn>& join_columns,
450 const std::vector<JoinColumnTypeInfo>& join_column_types,
451 const std::vector<JoinBucketInfo>& join_bucket_info,
454 decltype(std::chrono::steady_clock::now()) ts1, ts2;
455 ts1 = std::chrono::steady_clock::now();
456 const auto composite_key_info =
458 CHECK(!join_columns.empty());
459 CHECK(!join_bucket_info.empty());
462 const auto key_component_count =
463 join_bucket_info[0].inverse_bucket_sizes_for_dimension.size();
469 join_bucket_info[0].inverse_bucket_sizes_for_dimension.data());
473 dummy_str_proxy_translation_maps_ptrs_and_offsets;
475 builder.initHashTableOnCpu(&key_handler,
480 dummy_str_proxy_translation_maps_ptrs_and_offsets,
481 hash_table_entry_info,
485 ts2 = std::chrono::steady_clock::now();
487 throw HashJoinFail(std::string(
"Unrecognized error when initializing CPU "
488 "range join hash table (") +
491 std::shared_ptr<BaselineHashTable> hash_table = builder.getHashTable();
492 auto hashtable_build_time =
493 std::chrono::duration_cast<std::chrono::milliseconds>(ts2 - ts1).count();
498 hashtable_build_time);
503 const size_t shard_count,
504 std::vector<ColumnsForDevice>& columns_per_device) {
506 const auto [tuple_count, emitted_keys_count] =
511 const auto entry_count = 2 * std::max(tuple_count,
size_t(1));
513 return std::make_pair(
519 const std::vector<double>& inverse_bucket_sizes_for_dimension,
520 std::vector<ColumnsForDevice>& columns_per_device,
521 const size_t chosen_max_hashtable_size,
522 const double chosen_bucket_threshold) {
541 .bitmap_sz_bits = 11,
546 .sub_bitmap_count = 1,
549 const auto padded_size_bytes = count_distinct_desc.bitmapPaddedSizeBytes();
551 CHECK(!columns_per_device.empty() && !columns_per_device.front().join_columns.empty());
552 if (columns_per_device.front().join_columns.front().num_elems == 0) {
553 return std::make_pair(0, 0);
556 for (
auto& columns_for_device : columns_per_device) {
557 columns_for_device.setBucketInfo(inverse_bucket_sizes_for_dimension,
562 CHECK_EQ(columns_per_device.front().join_columns.size(),
563 columns_per_device.front().join_buckets.size());
565 const auto composite_key_info =
568 std::vector<uint8_t> hll_buffer_all_cpus(thread_count * padded_size_bytes);
569 auto hll_result = &hll_buffer_all_cpus[0];
571 std::vector<int32_t> num_keys_for_row;
572 num_keys_for_row.resize(columns_per_device.front().join_columns[0].num_elems);
576 count_distinct_desc.bitmap_sz_bits,
578 columns_per_device.front().join_columns,
579 columns_per_device.front().join_column_types,
580 columns_per_device.front().join_buckets,
584 for (
int i = 1; i < thread_count; ++i) {
586 hll_result + i * padded_size_bytes,
587 size_t(1) << count_distinct_desc.bitmap_sz_bits);
589 return std::make_pair(
hll_size(hll_result, count_distinct_desc.bitmap_sz_bits),
590 num_keys_for_row.size() > 0 ? num_keys_for_row.back() : 0);
593 auto& data_mgr = *
executor_->getDataMgr();
594 std::vector<std::vector<uint8_t>> host_hll_buffers(
device_count_);
595 for (
auto& host_hll_buffer : host_hll_buffers) {
596 host_hll_buffer.resize(count_distinct_desc.bitmapPaddedSizeBytes());
598 std::vector<size_t> emitted_keys_count_device_threads(
device_count_, 0);
599 std::vector<std::future<void>> approximate_distinct_device_threads;
600 for (
int device_id = 0; device_id <
device_count_; ++device_id) {
601 approximate_distinct_device_threads.emplace_back(
std::async(
605 &count_distinct_desc,
608 &emitted_keys_count_device_threads,
610 auto allocator = std::make_unique<CudaAllocator>(
612 auto device_hll_buffer =
613 allocator->alloc(count_distinct_desc.bitmapPaddedSizeBytes());
614 data_mgr.getCudaMgr()->zeroDeviceMem(
616 count_distinct_desc.bitmapPaddedSizeBytes(),
619 const auto& columns_for_device = columns_per_device[device_id];
621 columns_for_device.join_columns, *allocator);
623 CHECK_GT(columns_for_device.join_buckets.size(), 0u);
624 const auto& bucket_sizes_for_dimension =
625 columns_for_device.join_buckets[0].inverse_bucket_sizes_for_dimension;
626 auto bucket_sizes_gpu =
627 allocator->alloc(bucket_sizes_for_dimension.size() *
sizeof(double));
628 allocator->copyToDevice(bucket_sizes_gpu,
629 bucket_sizes_for_dimension.data(),
630 bucket_sizes_for_dimension.size() *
sizeof(double));
631 const size_t row_counts_buffer_sz =
632 columns_per_device.front().join_columns[0].num_elems *
sizeof(int32_t);
633 auto row_counts_buffer = allocator->alloc(row_counts_buffer_sz);
634 data_mgr.getCudaMgr()->zeroDeviceMem(
636 row_counts_buffer_sz,
639 const auto key_handler =
641 bucket_sizes_for_dimension.size(),
643 reinterpret_cast<double*
>(bucket_sizes_gpu));
644 const auto key_handler_gpu =
647 reinterpret_cast<uint8_t*>(device_hll_buffer),
648 count_distinct_desc.bitmap_sz_bits,
649 reinterpret_cast<int32_t*>(row_counts_buffer),
651 columns_for_device.join_columns[0].num_elems,
655 auto& host_emitted_keys_count = emitted_keys_count_device_threads[device_id];
656 allocator->copyFromDevice(
657 &host_emitted_keys_count,
659 (columns_per_device.front().join_columns[0].num_elems - 1) *
663 auto& host_hll_buffer = host_hll_buffers[device_id];
664 allocator->copyFromDevice(&host_hll_buffer[0],
666 count_distinct_desc.bitmapPaddedSizeBytes());
669 for (
auto& child : approximate_distinct_device_threads) {
673 auto& result_hll_buffer = host_hll_buffers.front();
674 auto hll_result =
reinterpret_cast<int32_t*
>(&result_hll_buffer[0]);
675 for (
int device_id = 1; device_id <
device_count_; ++device_id) {
676 auto& host_hll_buffer = host_hll_buffers[device_id];
678 reinterpret_cast<int32_t*>(&host_hll_buffer[0]),
679 size_t(1) << count_distinct_desc.bitmap_sz_bits);
681 size_t emitted_keys_count = 0;
682 for (
auto& emitted_keys_count_device : emitted_keys_count_device_threads) {
683 emitted_keys_count += emitted_keys_count_device;
685 return std::make_pair(
hll_size(hll_result, count_distinct_desc.bitmap_sz_bits),
693 #define LL_CONTEXT executor_->cgen_state_->context_
694 #define LL_BUILDER executor_->cgen_state_->ir_builder_
695 #define LL_INT(v) executor_->cgen_state_->llInt(v)
696 #define LL_FP(v) executor_->cgen_state_->llFp(v)
697 #define ROW_FUNC executor_->cgen_state_->row_func_
700 llvm::Value* offset_ptr) {
702 CHECK(key_component_width == 4 || key_component_width == 8);
704 llvm::Value* key_buff_lv{
nullptr};
705 switch (key_component_width) {
719 const auto outer_col = inner_outer_pair.second;
720 const auto outer_col_ti = outer_col->get_type_info();
722 if (outer_col_ti.is_geometry()) {
730 llvm::Value* arr_ptr{
nullptr};
732 if (
auto outer_col_var = dynamic_cast<const Analyzer::ColumnVar*>(outer_col)) {
733 const auto col_lvs = code_generator.
codegen(outer_col,
true, co);
734 CHECK_EQ(col_lvs.size(), size_t(1));
735 auto column_key = outer_col_var->getColumnKey();
736 if (column_key.table_id < 0) {
739 "Geospatial columns not yet supported in this temporary table context.");
741 column_key.column_id = column_key.column_id + 1;
744 const auto coords_ti = coords_cd->columnType;
746 const auto array_buff_ptr =
executor_->cgen_state_->emitExternalCall(
748 llvm::Type::getInt8PtrTy(
executor_->cgen_state_->context_),
749 {col_lvs.front(), code_generator.
posArg(outer_col)});
750 CHECK(array_buff_ptr);
752 <<
"Only TINYINT coordinates columns are supported in bounding box "
756 }
else if (
auto geo_expr_outer_col =
757 dynamic_cast<const Analyzer::GeoOperator*>(outer_col)) {
758 const auto geo_expr_name = geo_expr_outer_col->getName();
759 if (
func_resolve(geo_expr_name,
"ST_Point"sv,
"ST_Transform"sv,
"ST_Centroid"sv)) {
763 const auto col_lvs = code_generator.codegen(outer_col,
true, co);
769 col_lvs[0], llvm::Type::getInt8PtrTy(
executor_->cgen_state_->context_));
771 throw std::runtime_error(
772 "RHS key of the range join operator has a geospatial function which is not "
777 throw std::runtime_error(
"Range join operator has an invalid rhs key: " +
778 outer_col->toString());
783 LL_BUILDER.CreateLoad(offset_ptr->getType()->getPointerElementType(),
785 "packed_bucket_offset");
786 const auto x_offset =
789 const auto y_offset_shifted =
791 const auto y_offset =
794 const auto x_bucket_offset =
796 const auto y_bucket_offset =
799 for (
size_t i = 0; i < 2; i++) {
800 const auto key_comp_dest_lv =
LL_BUILDER.CreateGEP(
801 key_buff_lv->getType()->getScalarType()->getPointerElementType(),
805 const auto funcName =
isProbeCompressed() ?
"get_bucket_key_for_range_compressed"
806 :
"get_bucket_key_for_range_double";
810 auto bucket_key =
executor_->cgen_state_->emitExternalCall(
815 auto bucket_key_shifted = i == 0
816 ?
LL_BUILDER.CreateAdd(x_bucket_offset, bucket_key)
817 :
LL_BUILDER.CreateAdd(y_bucket_offset, bucket_key);
821 LL_BUILDER.CreateStore(col_lv, key_comp_dest_lv);
824 LOG(
FATAL) <<
"Range join key currently only supported for geospatial types.";
832 llvm::Value* range_offset) {
834 CHECK(key_component_width == 4 || key_component_width == 8);
836 auto key_buff_lv =
codegenKey(co, range_offset);
840 const auto composite_dict_ptr_type =
841 llvm::Type::getIntNPtrTy(
LL_CONTEXT, key_component_width * 8);
843 const auto composite_key_dict =
844 hash_ptr->getType()->isPointerTy()
845 ?
LL_BUILDER.CreatePointerCast(hash_ptr, composite_dict_ptr_type)
846 :
LL_BUILDER.CreateIntToPtr(hash_ptr, composite_dict_ptr_type);
850 const auto funcName =
851 "get_composite_key_index_" +
std::to_string(key_component_width * 8);
853 const auto key =
executor_->cgen_state_->emitExternalCall(funcName,
856 LL_INT(key_component_count),
860 auto one_to_many_ptr = hash_ptr;
861 if (one_to_many_ptr->getType()->isPointerTy()) {
865 CHECK(one_to_many_ptr->getType()->isIntegerTy(64));
static std::vector< int > collectFragmentIds(const std::vector< Fragmenter_Namespace::FragmentInfo > &fragments)
size_t getKeyComponentCount() const
virtual HashJoinMatchingSet codegenMatchingSet(const CompilationOptions &, const size_t)=0
void setBoundingBoxIntersectionMetaInfo(size_t max_table_size_bytes, double bucket_threshold, std::vector< double > &bucket_sizes)
std::mutex cpu_hash_table_buff_mutex_
llvm::Value * codegenKey(const CompilationOptions &co, llvm::Value *offset)
static llvm::Value * codegenHashTableLoad(const size_t table_idx, Executor *executor)
Data_Namespace::MemoryLevel getEffectiveMemoryLevel(const std::vector< InnerOuter > &inner_outer_pairs) const
size_t calculateHashTableSize(size_t number_of_dimensions, size_t emitted_keys_count, size_t entry_count) const
static bool isInvalidHashTableCacheKey(const std::vector< QueryPlanHash > &cache_keys)
std::pair< const Analyzer::ColumnVar *, const Analyzer::Expr * > InnerOuter
size_t getKeyComponentWidth() const
shared::TableKey getInnerTableId() const noexceptoverride
HashType getHashType() const noexceptoverride
std::vector< ChunkKey > cache_key_chunks
std::vector< QueryPlanHash > hashtable_cache_key_
T * transfer_flat_object_to_gpu(const T &object, DeviceAllocator &allocator)
std::unordered_set< size_t > table_keys_
static void checkHashJoinReplicationConstraint(const shared::TableKey &table_key, const size_t shard_count, const Executor *executor)
size_t offsetBufferOff() const noexceptoverride
void hll_unify(T1 *lhs, T2 *rhs, const size_t m)
llvm::Value * posArg(const Analyzer::Expr *) const
std::vector< std::shared_ptr< HashTable > > hash_tables_for_device_
const std::shared_ptr< Analyzer::BinOper > condition_
llvm::Value * castArrayPointer(llvm::Value *ptr, const SQLTypeInfo &elem_ti)
void reifyWithLayout(const HashType layout) override
const ColumnDescriptor * get_metadata_for_column(const ::shared::ColumnKey &column_key)
const InputTableInfo & get_inner_query_info(const shared::TableKey &inner_table_key, const std::vector< InputTableInfo > &query_infos)
std::vector< double > inverse_bucket_sizes_for_dimension_
#define DEBUG_TIMER_NEW_THREAD(parent_thread_id)
CompositeKeyInfo composite_key_info_
std::optional< HashType > layout_override_
CountDistinctImplType impl_type_
llvm::Type * get_int_type(const int width, llvm::LLVMContext &context)
size_t hll_size(const T *M, const size_t bitmap_sz_bits)
int initHashTableOnGpu(KEY_HANDLER *key_handler, const std::vector< JoinColumn > &join_columns, const JoinType join_type, const BaselineHashTableEntryInfo hash_table_entry_info, const int device_id, const Executor *executor, const RegisteredQueryHint &query_hint)
const Expr * get_left_operand() const
size_t shardCount() const
void setInverseBucketSizeInfo(const std::vector< double > &inverse_bucket_sizes, std::vector< ColumnsForDevice > &columns_per_device, const size_t device_count)
HashTableBuildDagMap hashtable_build_dag_map_
const std::vector< JoinColumnTypeInfo > join_column_types
ColumnsForDevice fetchColumnsForDevice(const std::vector< Fragmenter_Namespace::FragmentInfo > &fragments, const int device_id, DeviceAllocator *dev_buff_owner)
void approximate_distinct_tuples_on_device_range(uint8_t *hll_buffer, const uint32_t b, int32_t *row_counts_buffer, const RangeKeyHandler *key_handler, const size_t num_elems, const size_t block_size_x, const size_t grid_size_x)
future< Result > async(Fn &&fn, Args &&...args)
std::string toString() const override
std::unordered_map< size_t, HashTableBuildDag > HashTableBuildDagMap
HashType getHashTableLayout() const
const Data_Namespace::MemoryLevel memory_level_
std::pair< size_t, size_t > approximateTupleCount(const std::vector< double > &inverse_bucket_sizes_for_dimension, std::vector< ColumnsForDevice > &columns_per_device, const size_t chosen_max_hashtable_size, const double chosen_bucket_threshold) override
static std::unique_ptr< HashtableRecycler > hash_table_cache_
void generateCacheKey(const size_t max_hashtable_size, const double bucket_threshold, const std::vector< double > &bucket_sizes, std::vector< std::vector< Fragmenter_Namespace::FragmentInfo >> &fragments_per_device, int device_count)
std::vector< Fragmenter_Namespace::FragmentInfo > only_shards_for_device(const std::vector< Fragmenter_Namespace::FragmentInfo > &fragments, const int device_id, const int device_count)
const std::vector< InputTableInfo > & query_infos_
static constexpr size_t MAX_NUM_HASH_ENTRIES
static std::unordered_set< size_t > getAlternativeTableKeys(const std::vector< ChunkKey > &chunk_keys, const shared::TableKey &inner_table_key)
QueryPlanHash getAlternativeCacheKey(AlternativeCacheKeyForBoundingBoxIntersection &info)
std::pair< size_t, size_t > computeRangeHashTableCounts(const size_t shard_count, std::vector< ColumnsForDevice > &columns_per_device)
HashJoinMatchingSet codegenMatchingSetWithOffset(const CompilationOptions &, const size_t, llvm::Value *)
const double bucket_threshold_
const Expr * get_right_operand() const
static std::shared_ptr< RangeJoinHashTable > getInstance(const std::shared_ptr< Analyzer::BinOper > condition, const Analyzer::RangeOper *range_expr, const std::vector< InputTableInfo > &query_infos, const Data_Namespace::MemoryLevel memory_level, const JoinType join_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)
virtual shared::TableKey getInnerTableId() const noexcept=0
std::unordered_map< shared::TableKey, const RelAlgNode * > TableIdToNodeMap
std::vector< llvm::Value * > codegen(const Analyzer::Expr *, const bool fetch_columns, const CompilationOptions &)
std::pair< std::vector< const int32_t * >, std::vector< int32_t >> StrProxyTranslationMapsPtrsAndOffsets
bool isProbeCompressed() const
std::unique_ptr< BaselineHashTable > getHashTable()
static std::string getHashTypeString(HashType ht) noexcept
std::vector< InnerOuter > inner_outer_pairs_
size_t getEntryCount() const
LocalIdsScopeGuard setNewThreadId() const
size_t get_entries_per_device(const size_t total_entries, const size_t shard_count, const size_t device_count, const Data_Namespace::MemoryLevel memory_level)
std::unordered_map< shared::TableKey, std::unordered_map< int, std::shared_ptr< const ColumnarResults >>> ColumnCacheMap
std::shared_ptr< BaselineHashTable > initHashTableOnCpu(const std::vector< JoinColumn > &join_columns, const std::vector< JoinColumnTypeInfo > &join_column_types, const std::vector< JoinBucketInfo > &join_bucket_info, const BaselineHashTableEntryInfo hash_table_entry_info)
const JoinType join_type_
CUstream getQueryEngineCudaStreamForDevice(int device_num)
bool isInnerColCompressed() const
std::size_t hash_value(RexAbstractInput const &rex_ab_input)
void approximate_distinct_tuples_range(uint8_t *hll_buffer_all_cpus, std::vector< int32_t > &row_counts, const uint32_t b, const size_t padded_size_bytes, const std::vector< JoinColumn > &join_column_per_key, const std::vector< JoinColumnTypeInfo > &type_info_per_key, const std::vector< JoinBucketInfo > &join_buckets_per_key, const bool is_compressed, const int thread_count)
size_t getNumTuplesUpperBound() const
RegisteredQueryHint query_hints_
void putHashTableOnCpuToCache(QueryPlanHash key, CacheItemType item_type, std::shared_ptr< HashTable > hashtable_ptr, DeviceIdentifier device_identifier, size_t hashtable_building_time)
#define DEBUG_TIMER(name)
void reifyForDevice(const ColumnsForDevice &columns_for_device, const HashType layout, const size_t entry_count, const size_t emitted_keys_count, const int device_id, const logger::ThreadLocalIds parent_thread_local_ids)
Data_Namespace::MemoryLevel effective_memory_level_
T * transfer_vector_of_flat_objects_to_gpu(const std::vector< T > &vec, DeviceAllocator &allocator)
static size_t getShardCountForCondition(const Analyzer::BinOper *condition, const Executor *executor, const std::vector< InnerOuter > &inner_outer_pairs)
std::vector< JoinBucketInfo > join_buckets
std::shared_ptr< HashTable > initHashTableOnCpuFromCache(QueryPlanHash key, CacheItemType item_type, DeviceIdentifier device_identifier)
const Analyzer::RangeOper * range_expr_
static constexpr DeviceIdentifier CPU_DEVICE_IDENTIFIER
static HashtableAccessPathInfo getHashtableAccessPathInfo(const std::vector< InnerOuter > &inner_outer_pairs, const std::vector< InnerOuterStringOpInfos > &inner_outer_string_op_infos_pairs, const SQLOps op_type, const JoinType join_type, const HashTableBuildDagMap &hashtable_build_dag_map, int device_count, int shard_count, const std::vector< std::vector< Fragmenter_Namespace::FragmentInfo >> &frags_for_device, Executor *executor)
ThreadLocalIds thread_local_ids()
const std::vector< JoinColumn > join_columns
static bool layoutRequiresAdditionalBuffers(HashType layout) noexcept
const size_t max_hashtable_size_
static CompositeKeyInfo getCompositeKeyInfo(const std::vector< InnerOuter > &inner_outer_pairs, const Executor *executor, const std::vector< InnerOuterStringOpInfos > &inner_outer_string_op_infos_pairs={})
size_t getComponentBufferSize() const noexceptoverride