OmniSciDB  c0231cc57d
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HashJoinRuntime.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
23 #ifndef QUERYENGINE_HASHJOINRUNTIME_H
24 #define QUERYENGINE_HASHJOINRUNTIME_H
25 
26 #include <cstddef>
27 #include <cstdint>
28 #include <vector>
29 #include "../../../Shared/SqlTypesLayout.h"
30 #include "../../../Shared/sqltypes.h"
31 
32 #ifdef __CUDACC__
33 #include "../../DecodersImpl.h"
34 #else
35 #include "../../RuntimeFunctions.h"
36 #endif
37 #include "../../../Shared/funcannotations.h"
38 
39 struct GenericKeyHandler;
40 struct OverlapsKeyHandler;
41 struct RangeKeyHandler;
42 
43 struct HashEntryInfo {
44  alignas(sizeof(int64_t)) size_t hash_entry_count;
45  alignas(sizeof(int64_t)) int64_t bucket_normalization;
46 
47  inline size_t getNormalizedHashEntryCount() const {
49  auto modulo_res = hash_entry_count % static_cast<size_t>(bucket_normalization);
50  auto entry_count = hash_entry_count / static_cast<size_t>(bucket_normalization);
51  if (modulo_res) {
52  return entry_count + 1;
53  }
54  return entry_count;
55  }
56 
57  bool operator!() const { return !(this->getNormalizedHashEntryCount()); }
58 };
59 
61 
62 void init_hash_join_buff(int32_t* buff,
63  const int64_t entry_count,
64  const int32_t invalid_slot_val,
65  const int32_t cpu_thread_idx,
66  const int32_t cpu_thread_count);
67 
68 #ifndef __CUDACC__
69 #ifdef HAVE_TBB
70 
71 void init_hash_join_buff_tbb(int32_t* buff,
72  const int64_t entry_count,
73  const int32_t invalid_slot_val);
74 
75 #endif // #ifdef HAVE_TBB
76 #endif // #ifndef __CUDACC__
77 
78 void init_hash_join_buff_on_device(int32_t* buff,
79  const int64_t entry_count,
80  const int32_t invalid_slot_val);
81 
82 void init_baseline_hash_join_buff_32(int8_t* hash_join_buff,
83  const int64_t entry_count,
84  const size_t key_component_count,
85  const bool with_val_slot,
86  const int32_t invalid_slot_val,
87  const int32_t cpu_thread_idx,
88  const int32_t cpu_thread_count);
89 
90 void init_baseline_hash_join_buff_64(int8_t* hash_join_buff,
91  const int64_t entry_count,
92  const size_t key_component_count,
93  const bool with_val_slot,
94  const int32_t invalid_slot_val,
95  const int32_t cpu_thread_idx,
96  const int32_t cpu_thread_count);
97 
98 #ifndef __CUDACC__
99 #ifdef HAVE_TBB
100 
101 void init_baseline_hash_join_buff_tbb_32(int8_t* hash_join_buff,
102  const int64_t entry_count,
103  const size_t key_component_count,
104  const bool with_val_slot,
105  const int32_t invalid_slot_val);
106 
107 void init_baseline_hash_join_buff_tbb_64(int8_t* hash_join_buff,
108  const int64_t entry_count,
109  const size_t key_component_count,
110  const bool with_val_slot,
111  const int32_t invalid_slot_val);
112 
113 #endif // #ifdef HAVE_TBB
114 #endif // #ifndef __CUDACC__
115 
116 void init_baseline_hash_join_buff_on_device_32(int8_t* hash_join_buff,
117  const int64_t entry_count,
118  const size_t key_component_count,
119  const bool with_val_slot,
120  const int32_t invalid_slot_val);
121 
122 void init_baseline_hash_join_buff_on_device_64(int8_t* hash_join_buff,
123  const int64_t entry_count,
124  const size_t key_component_count,
125  const bool with_val_slot,
126  const int32_t invalid_slot_val);
127 
128 enum ColumnType { SmallDate = 0, Signed = 1, Unsigned = 2, Double = 3 };
129 
130 struct JoinChunk {
131  const int8_t*
132  col_buff; // actually from AbstractBuffer::getMemoryPtr() via Chunk_NS::Chunk
133  size_t num_elems;
134 };
135 
136 struct JoinColumn {
137  const int8_t*
138  col_chunks_buff; // actually a JoinChunk* from ColumnFetcher::makeJoinColumn()
140  size_t num_chunks;
141  size_t num_elems;
142  size_t elem_sz;
143 };
144 
146  const size_t elem_sz;
147  const int64_t min_val;
148  const int64_t max_val;
149  const int64_t null_val;
150  const bool uses_bw_eq;
151  const int64_t translated_null_val;
153 };
154 
156  if (ti.is_date_in_days()) {
157  return SmallDate;
158  } else {
159  return is_unsigned_type(ti) ? Unsigned : Signed;
160  }
161 }
162 
165  bool is_double; // TODO(adb): assume float otherwise (?)
166 };
167 
168 int fill_hash_join_buff_bucketized(int32_t* buff,
169  const int32_t invalid_slot_val,
170  const bool for_semi_join,
171  const JoinColumn join_column,
172  const JoinColumnTypeInfo type_info,
173  const int32_t* sd_inner_to_outer_translation_map,
174  const int32_t min_inner_elem,
175  const int32_t cpu_thread_idx,
176  const int32_t cpu_thread_count,
177  const int64_t bucket_normalization);
178 
179 int fill_hash_join_buff(int32_t* buff,
180  const int32_t invalid_slot_val,
181  const bool for_semi_join,
182  const JoinColumn join_column,
183  const JoinColumnTypeInfo type_info,
184  const int32_t* sd_inner_to_outer_translation_map,
185  const int32_t min_inner_elem,
186  const int32_t cpu_thread_idx,
187  const int32_t cpu_thread_count);
188 
189 void fill_hash_join_buff_on_device(int32_t* buff,
190  const int32_t invalid_slot_val,
191  const bool for_semi_join,
192  int* dev_err_buff,
193  const JoinColumn join_column,
194  const JoinColumnTypeInfo type_info);
195 
197  const int32_t invalid_slot_val,
198  const bool for_semi_join,
199  int* dev_err_buff,
200  const JoinColumn join_column,
201  const JoinColumnTypeInfo type_info,
202  const int64_t bucket_normalization);
203 
204 struct ShardInfo {
205  const size_t shard;
206  const size_t entry_count_per_shard;
207  const size_t num_shards;
208  const int device_count;
209 };
210 
211 void fill_hash_join_buff_on_device_sharded(int32_t* buff,
212  const int32_t invalid_slot_val,
213  const bool for_semi_join,
214  int* dev_err_buff,
215  const JoinColumn join_column,
216  const JoinColumnTypeInfo type_info,
217  const ShardInfo shard_info);
218 
220  const int32_t invalid_slot_val,
221  const bool for_semi_join,
222  int* dev_err_buff,
223  const JoinColumn join_column,
224  const JoinColumnTypeInfo type_info,
225  const ShardInfo shard_info,
226  const int64_t bucket_normalization);
227 
228 void fill_one_to_many_hash_table(int32_t* buff,
229  const HashEntryInfo hash_entry_info,
230  const JoinColumn& join_column,
231  const JoinColumnTypeInfo& type_info,
232  const int32_t* sd_inner_to_outer_translation_map,
233  const int32_t min_inner_elem,
234  const unsigned cpu_thread_count);
235 
237  int32_t* buff,
238  const HashEntryInfo hash_entry_info,
239  const JoinColumn& join_column,
240  const JoinColumnTypeInfo& type_info,
241  const int32_t* sd_inner_to_outer_translation_map,
242  const int32_t min_inner_elem,
243  const unsigned cpu_thread_count);
244 
246  int32_t* buff,
247  const HashEntryInfo hash_entry_info,
248  const int32_t invalid_slot_val,
249  const JoinColumn& join_column,
250  const JoinColumnTypeInfo& type_info,
251  const ShardInfo& shard_info,
252  const int32_t* sd_inner_to_outer_translation_map,
253  const int32_t min_inner_elem,
254  const unsigned cpu_thread_count);
255 
256 void fill_one_to_many_hash_table_on_device(int32_t* buff,
257  const HashEntryInfo hash_entry_info,
258  const JoinColumn& join_column,
259  const JoinColumnTypeInfo& type_info);
260 
262  int32_t* buff,
263  const HashEntryInfo hash_entry_info,
264  const JoinColumn& join_column,
265  const JoinColumnTypeInfo& type_info);
266 
268  const HashEntryInfo hash_entry_info,
269  const JoinColumn& join_column,
270  const JoinColumnTypeInfo& type_info,
271  const ShardInfo& shard_info);
272 
273 int fill_baseline_hash_join_buff_32(int8_t* hash_buff,
274  const int64_t entry_count,
275  const int32_t invalid_slot_val,
276  const bool for_semi_join,
277  const size_t key_component_count,
278  const bool with_val_slot,
279  const GenericKeyHandler* key_handler,
280  const int64_t num_elems,
281  const int32_t cpu_thread_idx,
282  const int32_t cpu_thread_count);
283 
284 int overlaps_fill_baseline_hash_join_buff_32(int8_t* hash_buff,
285  const int64_t entry_count,
286  const int32_t invalid_slot_val,
287  const size_t key_component_count,
288  const bool with_val_slot,
289  const OverlapsKeyHandler* key_handler,
290  const int64_t num_elems,
291  const int32_t cpu_thread_idx,
292  const int32_t cpu_thread_count);
293 
294 int range_fill_baseline_hash_join_buff_32(int8_t* hash_buff,
295  const size_t entry_count,
296  const int32_t invalid_slot_val,
297  const size_t key_component_count,
298  const bool with_val_slot,
299  const RangeKeyHandler* key_handler,
300  const size_t num_elems,
301  const int32_t cpu_thread_idx,
302  const int32_t cpu_thread_count);
303 
304 int fill_baseline_hash_join_buff_64(int8_t* hash_buff,
305  const int64_t entry_count,
306  const int32_t invalid_slot_val,
307  const bool for_semi_join,
308  const size_t key_component_count,
309  const bool with_val_slot,
310  const GenericKeyHandler* key_handler,
311  const int64_t num_elems,
312  const int32_t cpu_thread_idx,
313  const int32_t cpu_thread_count);
314 
315 int overlaps_fill_baseline_hash_join_buff_64(int8_t* hash_buff,
316  const int64_t entry_count,
317  const int32_t invalid_slot_val,
318  const size_t key_component_count,
319  const bool with_val_slot,
320  const OverlapsKeyHandler* key_handler,
321  const int64_t num_elems,
322  const int32_t cpu_thread_idx,
323  const int32_t cpu_thread_count);
324 
325 int range_fill_baseline_hash_join_buff_64(int8_t* hash_buff,
326  const size_t entry_count,
327  const int32_t invalid_slot_val,
328  const size_t key_component_count,
329  const bool with_val_slot,
330  const RangeKeyHandler* key_handler,
331  const size_t num_elems,
332  const int32_t cpu_thread_idx,
333  const int32_t cpu_thread_count);
334 
335 void fill_baseline_hash_join_buff_on_device_32(int8_t* hash_buff,
336  const int64_t entry_count,
337  const int32_t invalid_slot_val,
338  const bool for_semi_join,
339  const size_t key_component_count,
340  const bool with_val_slot,
341  int* dev_err_buff,
342  const GenericKeyHandler* key_handler,
343  const int64_t num_elems);
344 
345 void fill_baseline_hash_join_buff_on_device_64(int8_t* hash_buff,
346  const int64_t entry_count,
347  const int32_t invalid_slot_val,
348  const bool for_semi_join,
349  const size_t key_component_count,
350  const bool with_val_slot,
351  int* dev_err_buff,
352  const GenericKeyHandler* key_handler,
353  const int64_t num_elems);
354 
356  int8_t* hash_buff,
357  const int64_t entry_count,
358  const int32_t invalid_slot_val,
359  const size_t key_component_count,
360  const bool with_val_slot,
361  int* dev_err_buff,
362  const OverlapsKeyHandler* key_handler,
363  const int64_t num_elems);
364 
366  const int64_t entry_count,
367  const int32_t invalid_slot_val,
368  const size_t key_component_count,
369  const bool with_val_slot,
370  int* dev_err_buff,
371  const RangeKeyHandler* key_handler,
372  const size_t num_elems);
373 
375  int32_t* buff,
376  const int32_t* composite_key_dict,
377  const int64_t hash_entry_count,
378  const size_t key_component_count,
379  const std::vector<JoinColumn>& join_column_per_key,
380  const std::vector<JoinColumnTypeInfo>& type_info_per_key,
381  const std::vector<JoinBucketInfo>& join_bucket_info,
382  const std::vector<const int32_t*>& sd_inner_to_outer_translation_maps,
383  const std::vector<int32_t>& sd_min_inner_elems,
384  const int32_t cpu_thread_count,
385  const bool is_range_join = false,
386  const bool is_geo_compressed = false);
387 
389  int32_t* buff,
390  const int64_t* composite_key_dict,
391  const int64_t hash_entry_count,
392  const size_t key_component_count,
393  const std::vector<JoinColumn>& join_column_per_key,
394  const std::vector<JoinColumnTypeInfo>& type_info_per_key,
395  const std::vector<JoinBucketInfo>& join_bucket_info,
396  const std::vector<const int32_t*>& sd_inner_to_outer_translation_maps,
397  const std::vector<int32_t>& sd_min_inner_elems,
398  const int32_t cpu_thread_count,
399  const bool is_range_join = false,
400  const bool is_geo_compressed = false);
401 
403  int32_t* buff,
404  const int32_t* composite_key_dict,
405  const int64_t hash_entry_count,
406  const size_t key_component_count,
407  const GenericKeyHandler* key_handler,
408  const int64_t num_elems);
409 
411  int32_t* buff,
412  const int64_t* composite_key_dict,
413  const int64_t hash_entry_count,
414  const GenericKeyHandler* key_handler,
415  const int64_t num_elems);
416 
418  int32_t* buff,
419  const int64_t* composite_key_dict,
420  const int64_t hash_entry_count,
421  const OverlapsKeyHandler* key_handler,
422  const int64_t num_elems);
423 
425  int32_t* buff,
426  const int64_t* composite_key_dict,
427  const size_t hash_entry_count,
428  const RangeKeyHandler* key_handler,
429  const size_t num_elems);
430 
431 void approximate_distinct_tuples(uint8_t* hll_buffer_all_cpus,
432  const uint32_t b,
433  const size_t padded_size_bytes,
434  const std::vector<JoinColumn>& join_column_per_key,
435  const std::vector<JoinColumnTypeInfo>& type_info_per_key,
436  const int thread_count);
437 
439  uint8_t* hll_buffer_all_cpus,
440  std::vector<int32_t>& row_counts,
441  const uint32_t b,
442  const size_t padded_size_bytes,
443  const std::vector<JoinColumn>& join_column_per_key,
444  const std::vector<JoinColumnTypeInfo>& type_info_per_key,
445  const std::vector<JoinBucketInfo>& join_buckets_per_key,
446  const int thread_count);
447 
449  uint8_t* hll_buffer_all_cpus,
450  std::vector<int32_t>& row_counts,
451  const uint32_t b,
452  const size_t padded_size_bytes,
453  const std::vector<JoinColumn>& join_column_per_key,
454  const std::vector<JoinColumnTypeInfo>& type_info_per_key,
455  const std::vector<JoinBucketInfo>& join_buckets_per_key,
456  const bool is_compressed,
457  const int thread_count);
458 
459 void approximate_distinct_tuples_on_device(uint8_t* hll_buffer,
460  const uint32_t b,
461  const GenericKeyHandler* key_handler,
462  const int64_t num_elems);
463 
464 void approximate_distinct_tuples_on_device_overlaps(uint8_t* hll_buffer,
465  const uint32_t b,
466  int32_t* row_counts_buffer,
467  const OverlapsKeyHandler* key_handler,
468  const int64_t num_elems);
469 
470 void compute_bucket_sizes_on_cpu(std::vector<double>& bucket_sizes_for_dimension,
471  const JoinColumn& join_column,
472  const JoinColumnTypeInfo& type_info,
473  const std::vector<double>& bucket_size_thresholds,
474  const int thread_count);
475 
476 void approximate_distinct_tuples_on_device_range(uint8_t* hll_buffer,
477  const uint32_t b,
478  int32_t* row_counts_buffer,
479  const RangeKeyHandler* key_handler,
480  const size_t num_elems,
481  const size_t block_size_x,
482  const size_t grid_size_x);
483 
484 void compute_bucket_sizes_on_device(double* bucket_sizes_buffer,
485  const JoinColumn* join_column,
486  const JoinColumnTypeInfo* type_info,
487  const double* bucket_size_thresholds);
488 
489 #endif // QUERYENGINE_HASHJOINRUNTIME_H
const ColumnType column_type
const size_t num_shards
void fill_hash_join_buff_on_device_bucketized(int32_t *buff, const int32_t invalid_slot_val, const bool for_semi_join, int *dev_err_buff, const JoinColumn join_column, const JoinColumnTypeInfo type_info, const int64_t bucket_normalization)
DEVICE int SUFFIX() fill_hash_join_buff_bucketized(int32_t *buff, const int32_t invalid_slot_val, const bool for_semi_join, const JoinColumn join_column, const JoinColumnTypeInfo type_info, const int32_t *sd_inner_to_outer_translation_map, const int32_t min_inner_elem, const int32_t cpu_thread_idx, const int32_t cpu_thread_count, const int64_t bucket_normalization)
void fill_one_to_many_baseline_hash_table_on_device_64(int32_t *buff, const int64_t *composite_key_dict, const int64_t hash_entry_count, const GenericKeyHandler *key_handler, const int64_t num_elems)
void fill_one_to_many_hash_table_on_device(int32_t *buff, const HashEntryInfo hash_entry_info, const JoinColumn &join_column, const JoinColumnTypeInfo &type_info)
void init_baseline_hash_join_buff_32(int8_t *hash_join_buff, const int64_t entry_count, const size_t key_component_count, const bool with_val_slot, const int32_t invalid_slot_val, const int32_t cpu_thread_idx, const int32_t cpu_thread_count)
size_t num_elems
void init_baseline_hash_join_buff_on_device_64(int8_t *hash_join_buff, const int64_t entry_count, const size_t key_component_count, const bool with_val_slot, const int32_t invalid_slot_val)
void fill_baseline_hash_join_buff_on_device_32(int8_t *hash_buff, const int64_t entry_count, const int32_t invalid_slot_val, const bool for_semi_join, const size_t key_component_count, const bool with_val_slot, int *dev_err_buff, const GenericKeyHandler *key_handler, const int64_t num_elems)
void fill_hash_join_buff_on_device_sharded(int32_t *buff, const int32_t invalid_slot_val, const bool for_semi_join, int *dev_err_buff, const JoinColumn join_column, const JoinColumnTypeInfo type_info, const ShardInfo shard_info)
const size_t elem_sz
void range_fill_baseline_hash_join_buff_on_device_64(int8_t *hash_buff, const int64_t entry_count, const int32_t invalid_slot_val, const size_t key_component_count, const bool with_val_slot, int *dev_err_buff, const RangeKeyHandler *key_handler, const size_t num_elems)
const int device_count
const int64_t null_val
void init_baseline_hash_join_buff_64(int8_t *hash_join_buff, const int64_t entry_count, const size_t key_component_count, const bool with_val_slot, const int32_t invalid_slot_val, const int32_t cpu_thread_idx, const int32_t cpu_thread_count)
std::vector< double > inverse_bucket_sizes_for_dimension
const int8_t * col_buff
#define CHECK_GT(x, y)
Definition: Logger.h:234
void overlaps_fill_baseline_hash_join_buff_on_device_64(int8_t *hash_buff, const int64_t entry_count, const int32_t invalid_slot_val, const size_t key_component_count, const bool with_val_slot, int *dev_err_buff, const OverlapsKeyHandler *key_handler, const int64_t num_elems)
const size_t entry_count_per_shard
void fill_one_to_many_baseline_hash_table_on_device_32(int32_t *buff, const int32_t *composite_key_dict, const int64_t hash_entry_count, const size_t key_component_count, const GenericKeyHandler *key_handler, const int64_t num_elems)
const int64_t translated_null_val
void compute_bucket_sizes_on_device(double *bucket_sizes_buffer, const JoinColumn *join_column, const JoinColumnTypeInfo *type_info, const double *bucket_size_thresholds)
void init_baseline_hash_join_buff_on_device_32(int8_t *hash_join_buff, const int64_t entry_count, const size_t key_component_count, const bool with_val_slot, const int32_t invalid_slot_val)
void approximate_distinct_tuples(uint8_t *hll_buffer_all_cpus, 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 int thread_count)
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)
size_t col_chunks_buff_sz
void fill_one_to_many_hash_table_sharded_bucketized(int32_t *buff, const HashEntryInfo hash_entry_info, const int32_t invalid_slot_val, const JoinColumn &join_column, const JoinColumnTypeInfo &type_info, const ShardInfo &shard_info, const int32_t *sd_inner_to_outer_translation_map, const int32_t min_inner_elem, const unsigned cpu_thread_count)
void fill_one_to_many_hash_table_bucketized(int32_t *buff, const HashEntryInfo hash_entry_info, const JoinColumn &join_column, const JoinColumnTypeInfo &type_info, const int32_t *sd_inner_to_outer_translation_map, const int32_t min_inner_elem, const unsigned cpu_thread_count)
void compute_bucket_sizes_on_cpu(std::vector< double > &bucket_sizes_for_dimension, const JoinColumn &join_column, const JoinColumnTypeInfo &type_info, const std::vector< double > &bucket_size_thresholds, const int thread_count)
int64_t bucket_normalization
void fill_one_to_many_hash_table_on_device_bucketized(int32_t *buff, const HashEntryInfo hash_entry_info, const JoinColumn &join_column, const JoinColumnTypeInfo &type_info)
void fill_one_to_many_baseline_hash_table_64(int32_t *buff, const int64_t *composite_key_dict, const int64_t hash_entry_count, const size_t key_component_count, const std::vector< JoinColumn > &join_column_per_key, const std::vector< JoinColumnTypeInfo > &type_info_per_key, const std::vector< JoinBucketInfo > &join_bucket_info, const std::vector< const int32_t * > &sd_inner_to_outer_translation_maps, const std::vector< int32_t > &sd_min_inner_elems, const int32_t cpu_thread_count, const bool is_range_join, const bool is_geo_compressed)
int fill_baseline_hash_join_buff_64(int8_t *hash_buff, const int64_t entry_count, const int32_t invalid_slot_val, const bool for_semi_join, const size_t key_component_count, const bool with_val_slot, const GenericKeyHandler *key_handler, const int64_t num_elems, const int32_t cpu_thread_idx, const int32_t cpu_thread_count)
const size_t shard
size_t hash_entry_count
const int8_t * col_chunks_buff
void init_hash_join_buff_on_device(int32_t *buff, const int64_t entry_count, const int32_t invalid_slot_val)
void fill_one_to_many_hash_table_on_device_sharded(int32_t *buff, const HashEntryInfo hash_entry_info, const JoinColumn &join_column, const JoinColumnTypeInfo &type_info, const ShardInfo &shard_info)
DEVICE int SUFFIX() fill_hash_join_buff(int32_t *buff, const int32_t invalid_slot_val, const bool for_semi_join, const JoinColumn join_column, const JoinColumnTypeInfo type_info, const int32_t *sd_inner_to_outer_translation_map, const int32_t min_inner_elem, const int32_t cpu_thread_idx, const int32_t cpu_thread_count)
const int64_t max_val
void range_fill_one_to_many_baseline_hash_table_on_device_64(int32_t *buff, const int64_t *composite_key_dict, const size_t hash_entry_count, const RangeKeyHandler *key_handler, const size_t num_elems)
int range_fill_baseline_hash_join_buff_64(int8_t *hash_buff, const size_t entry_count, const int32_t invalid_slot_val, const size_t key_component_count, const bool with_val_slot, const RangeKeyHandler *key_handler, const size_t num_elems, const int32_t cpu_thread_idx, const int32_t cpu_thread_count)
ColumnType
void approximate_distinct_tuples_overlaps(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 int thread_count)
bool is_date_in_days() const
Definition: sqltypes.h:998
int overlaps_fill_baseline_hash_join_buff_64(int8_t *hash_buff, const int64_t entry_count, const int32_t invalid_slot_val, const size_t key_component_count, const bool with_val_slot, const OverlapsKeyHandler *key_handler, const int64_t num_elems, const int32_t cpu_thread_idx, const int32_t cpu_thread_count)
int range_fill_baseline_hash_join_buff_32(int8_t *hash_buff, const size_t entry_count, const int32_t invalid_slot_val, const size_t key_component_count, const bool with_val_slot, const RangeKeyHandler *key_handler, const size_t num_elems, const int32_t cpu_thread_idx, const int32_t cpu_thread_count)
bool operator!() const
void fill_one_to_many_hash_table(int32_t *buff, const HashEntryInfo hash_entry_info, const JoinColumn &join_column, const JoinColumnTypeInfo &type_info, const int32_t *sd_inner_to_outer_translation_map, const int32_t min_inner_elem, const unsigned cpu_thread_count)
DEVICE void SUFFIX() init_hash_join_buff(int32_t *groups_buffer, const int64_t hash_entry_count, const int32_t invalid_slot_val, const int32_t cpu_thread_idx, const int32_t cpu_thread_count)
const int64_t min_val
int overlaps_fill_baseline_hash_join_buff_32(int8_t *hash_buff, const int64_t entry_count, const int32_t invalid_slot_val, const size_t key_component_count, const bool with_val_slot, const OverlapsKeyHandler *key_handler, const int64_t num_elems, const int32_t cpu_thread_idx, const int32_t cpu_thread_count)
size_t getNormalizedHashEntryCount() const
void approximate_distinct_tuples_on_device(uint8_t *hll_buffer, const uint32_t b, const GenericKeyHandler *key_handler, const int64_t num_elems)
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)
ColumnType get_join_column_type_kind(const SQLTypeInfo &ti)
size_t num_chunks
void fill_baseline_hash_join_buff_on_device_64(int8_t *hash_buff, const int64_t entry_count, const int32_t invalid_slot_val, const bool for_semi_join, const size_t key_component_count, const bool with_val_slot, int *dev_err_buff, const GenericKeyHandler *key_handler, const int64_t num_elems)
void overlaps_fill_one_to_many_baseline_hash_table_on_device_64(int32_t *buff, const int64_t *composite_key_dict, const int64_t hash_entry_count, const OverlapsKeyHandler *key_handler, const int64_t num_elems)
void fill_one_to_many_baseline_hash_table_32(int32_t *buff, const int32_t *composite_key_dict, const int64_t hash_entry_count, const size_t key_component_count, const std::vector< JoinColumn > &join_column_per_key, const std::vector< JoinColumnTypeInfo > &type_info_per_key, const std::vector< JoinBucketInfo > &join_bucket_info, const std::vector< const int32_t * > &sd_inner_to_outer_translation_maps, const std::vector< int32_t > &sd_min_inner_elems, const int32_t cpu_thread_count, const bool is_range_join, const bool is_geo_compressed)
void fill_hash_join_buff_on_device(int32_t *buff, const int32_t invalid_slot_val, const bool for_semi_join, int *dev_err_buff, const JoinColumn join_column, const JoinColumnTypeInfo type_info)
int fill_baseline_hash_join_buff_32(int8_t *hash_buff, const int64_t entry_count, const int32_t invalid_slot_val, const bool for_semi_join, const size_t key_component_count, const bool with_val_slot, const GenericKeyHandler *key_handler, const int64_t num_elems, const int32_t cpu_thread_idx, const int32_t cpu_thread_count)
size_t num_elems
const size_t g_maximum_conditions_to_coalesce
void approximate_distinct_tuples_on_device_overlaps(uint8_t *hll_buffer, const uint32_t b, int32_t *row_counts_buffer, const OverlapsKeyHandler *key_handler, const int64_t num_elems)
void fill_hash_join_buff_on_device_sharded_bucketized(int32_t *buff, const int32_t invalid_slot_val, const bool for_semi_join, int *dev_err_buff, const JoinColumn join_column, const JoinColumnTypeInfo type_info, const ShardInfo shard_info, const int64_t bucket_normalization)
bool is_unsigned_type(const SQLTypeInfo &ti)