OmniSciDB  085a039ca4
 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 2017 MapD Technologies, 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 
17 /*
18  * @file HashJoinRuntime.h
19  * @author Alex Suhan <alex@mapd.com>
20  *
21  * Copyright (c) 2015 MapD Technologies, Inc. All rights reserved.
22  */
23 
24 #ifndef QUERYENGINE_HASHJOINRUNTIME_H
25 #define QUERYENGINE_HASHJOINRUNTIME_H
26 
27 #include <cstddef>
28 #include <cstdint>
29 #include <vector>
30 #include "../../../Shared/SqlTypesLayout.h"
31 #include "../../../Shared/sqltypes.h"
32 
33 #ifdef __CUDACC__
34 #include "../../DecodersImpl.h"
35 #else
36 #include "../../RuntimeFunctions.h"
37 #endif
38 #include "../../../Shared/funcannotations.h"
39 
40 struct GenericKeyHandler;
41 struct OverlapsKeyHandler;
42 struct RangeKeyHandler;
43 
44 struct HashEntryInfo {
45  alignas(sizeof(int64_t)) size_t hash_entry_count;
46  alignas(sizeof(int64_t)) int64_t bucket_normalization;
47 
48  inline size_t getNormalizedHashEntryCount() const {
50  auto modulo_res = hash_entry_count % static_cast<size_t>(bucket_normalization);
51  auto entry_count = hash_entry_count / static_cast<size_t>(bucket_normalization);
52  if (modulo_res) {
53  return entry_count + 1;
54  }
55  return entry_count;
56  }
57 
58  bool operator!() const { return !(this->getNormalizedHashEntryCount()); }
59 };
60 
62 
63 void init_hash_join_buff(int32_t* buff,
64  const int64_t entry_count,
65  const int32_t invalid_slot_val,
66  const int32_t cpu_thread_idx,
67  const int32_t cpu_thread_count);
68 
69 #ifndef __CUDACC__
70 #ifdef HAVE_TBB
71 
72 void init_hash_join_buff_tbb(int32_t* buff,
73  const int64_t entry_count,
74  const int32_t invalid_slot_val);
75 
76 #endif // #ifdef HAVE_TBB
77 #endif // #ifndef __CUDACC__
78 
79 void init_hash_join_buff_on_device(int32_t* buff,
80  const int64_t entry_count,
81  const int32_t invalid_slot_val);
82 
83 void init_baseline_hash_join_buff_32(int8_t* hash_join_buff,
84  const int64_t entry_count,
85  const size_t key_component_count,
86  const bool with_val_slot,
87  const int32_t invalid_slot_val,
88  const int32_t cpu_thread_idx,
89  const int32_t cpu_thread_count);
90 
91 void init_baseline_hash_join_buff_64(int8_t* hash_join_buff,
92  const int64_t entry_count,
93  const size_t key_component_count,
94  const bool with_val_slot,
95  const int32_t invalid_slot_val,
96  const int32_t cpu_thread_idx,
97  const int32_t cpu_thread_count);
98 
99 #ifndef __CUDACC__
100 #ifdef HAVE_TBB
101 
102 void init_baseline_hash_join_buff_tbb_32(int8_t* hash_join_buff,
103  const int64_t entry_count,
104  const size_t key_component_count,
105  const bool with_val_slot,
106  const int32_t invalid_slot_val);
107 
108 void init_baseline_hash_join_buff_tbb_64(int8_t* hash_join_buff,
109  const int64_t entry_count,
110  const size_t key_component_count,
111  const bool with_val_slot,
112  const int32_t invalid_slot_val);
113 
114 #endif // #ifdef HAVE_TBB
115 #endif // #ifndef __CUDACC__
116 
117 void init_baseline_hash_join_buff_on_device_32(int8_t* hash_join_buff,
118  const int64_t entry_count,
119  const size_t key_component_count,
120  const bool with_val_slot,
121  const int32_t invalid_slot_val);
122 
123 void init_baseline_hash_join_buff_on_device_64(int8_t* hash_join_buff,
124  const int64_t entry_count,
125  const size_t key_component_count,
126  const bool with_val_slot,
127  const int32_t invalid_slot_val);
128 
129 enum ColumnType { SmallDate = 0, Signed = 1, Unsigned = 2, Double = 3 };
130 
131 struct JoinChunk {
132  const int8_t*
133  col_buff; // actually from AbstractBuffer::getMemoryPtr() via Chunk_NS::Chunk
134  size_t num_elems;
135 };
136 
137 struct JoinColumn {
138  const int8_t*
139  col_chunks_buff; // actually a JoinChunk* from ColumnFetcher::makeJoinColumn()
141  size_t num_chunks;
142  size_t num_elems;
143  size_t elem_sz;
144 };
145 
147  const size_t elem_sz;
148  const int64_t min_val;
149  const int64_t max_val;
150  const int64_t null_val;
151  const bool uses_bw_eq;
152  const int64_t translated_null_val;
154 };
155 
157  if (ti.is_date_in_days()) {
158  return SmallDate;
159  } else {
160  return is_unsigned_type(ti) ? Unsigned : Signed;
161  }
162 }
163 
166  bool is_double; // TODO(adb): assume float otherwise (?)
167 };
168 
169 int fill_hash_join_buff_bucketized(int32_t* buff,
170  const int32_t invalid_slot_val,
171  const bool for_semi_join,
172  const JoinColumn join_column,
173  const JoinColumnTypeInfo type_info,
174  const int32_t* sd_inner_to_outer_translation_map,
175  const int32_t min_inner_elem,
176  const int32_t cpu_thread_idx,
177  const int32_t cpu_thread_count,
178  const int64_t bucket_normalization);
179 
180 int fill_hash_join_buff(int32_t* buff,
181  const int32_t invalid_slot_val,
182  const bool for_semi_join,
183  const JoinColumn join_column,
184  const JoinColumnTypeInfo type_info,
185  const int32_t* sd_inner_to_outer_translation_map,
186  const int32_t min_inner_elem,
187  const int32_t cpu_thread_idx,
188  const int32_t cpu_thread_count);
189 
190 void fill_hash_join_buff_on_device(int32_t* buff,
191  const int32_t invalid_slot_val,
192  const bool for_semi_join,
193  int* dev_err_buff,
194  const JoinColumn join_column,
195  const JoinColumnTypeInfo type_info);
196 
198  const int32_t invalid_slot_val,
199  const bool for_semi_join,
200  int* dev_err_buff,
201  const JoinColumn join_column,
202  const JoinColumnTypeInfo type_info,
203  const int64_t bucket_normalization);
204 
205 struct ShardInfo {
206  const size_t shard;
207  const size_t entry_count_per_shard;
208  const size_t num_shards;
209  const int device_count;
210 };
211 
212 void fill_hash_join_buff_on_device_sharded(int32_t* buff,
213  const int32_t invalid_slot_val,
214  const bool for_semi_join,
215  int* dev_err_buff,
216  const JoinColumn join_column,
217  const JoinColumnTypeInfo type_info,
218  const ShardInfo shard_info);
219 
221  const int32_t invalid_slot_val,
222  const bool for_semi_join,
223  int* dev_err_buff,
224  const JoinColumn join_column,
225  const JoinColumnTypeInfo type_info,
226  const ShardInfo shard_info,
227  const int64_t bucket_normalization);
228 
229 void fill_one_to_many_hash_table(int32_t* buff,
230  const HashEntryInfo hash_entry_info,
231  const JoinColumn& join_column,
232  const JoinColumnTypeInfo& type_info,
233  const int32_t* sd_inner_to_outer_translation_map,
234  const int32_t min_inner_elem,
235  const unsigned cpu_thread_count);
236 
238  int32_t* buff,
239  const HashEntryInfo hash_entry_info,
240  const JoinColumn& join_column,
241  const JoinColumnTypeInfo& type_info,
242  const int32_t* sd_inner_to_outer_translation_map,
243  const int32_t min_inner_elem,
244  const unsigned cpu_thread_count);
245 
247  int32_t* buff,
248  const HashEntryInfo hash_entry_info,
249  const int32_t invalid_slot_val,
250  const JoinColumn& join_column,
251  const JoinColumnTypeInfo& type_info,
252  const ShardInfo& shard_info,
253  const int32_t* sd_inner_to_outer_translation_map,
254  const int32_t min_inner_elem,
255  const unsigned cpu_thread_count);
256 
257 void fill_one_to_many_hash_table_on_device(int32_t* buff,
258  const HashEntryInfo hash_entry_info,
259  const JoinColumn& join_column,
260  const JoinColumnTypeInfo& type_info);
261 
263  int32_t* buff,
264  const HashEntryInfo hash_entry_info,
265  const JoinColumn& join_column,
266  const JoinColumnTypeInfo& type_info);
267 
269  const HashEntryInfo hash_entry_info,
270  const JoinColumn& join_column,
271  const JoinColumnTypeInfo& type_info,
272  const ShardInfo& shard_info);
273 
274 int fill_baseline_hash_join_buff_32(int8_t* hash_buff,
275  const int64_t entry_count,
276  const int32_t invalid_slot_val,
277  const bool for_semi_join,
278  const size_t key_component_count,
279  const bool with_val_slot,
280  const GenericKeyHandler* key_handler,
281  const int64_t num_elems,
282  const int32_t cpu_thread_idx,
283  const int32_t cpu_thread_count);
284 
285 int overlaps_fill_baseline_hash_join_buff_32(int8_t* hash_buff,
286  const int64_t entry_count,
287  const int32_t invalid_slot_val,
288  const size_t key_component_count,
289  const bool with_val_slot,
290  const OverlapsKeyHandler* key_handler,
291  const int64_t num_elems,
292  const int32_t cpu_thread_idx,
293  const int32_t cpu_thread_count);
294 
295 int range_fill_baseline_hash_join_buff_32(int8_t* hash_buff,
296  const size_t entry_count,
297  const int32_t invalid_slot_val,
298  const size_t key_component_count,
299  const bool with_val_slot,
300  const RangeKeyHandler* key_handler,
301  const size_t num_elems,
302  const int32_t cpu_thread_idx,
303  const int32_t cpu_thread_count);
304 
305 int fill_baseline_hash_join_buff_64(int8_t* hash_buff,
306  const int64_t entry_count,
307  const int32_t invalid_slot_val,
308  const bool for_semi_join,
309  const size_t key_component_count,
310  const bool with_val_slot,
311  const GenericKeyHandler* key_handler,
312  const int64_t num_elems,
313  const int32_t cpu_thread_idx,
314  const int32_t cpu_thread_count);
315 
316 int overlaps_fill_baseline_hash_join_buff_64(int8_t* hash_buff,
317  const int64_t entry_count,
318  const int32_t invalid_slot_val,
319  const size_t key_component_count,
320  const bool with_val_slot,
321  const OverlapsKeyHandler* key_handler,
322  const int64_t num_elems,
323  const int32_t cpu_thread_idx,
324  const int32_t cpu_thread_count);
325 
326 int range_fill_baseline_hash_join_buff_64(int8_t* hash_buff,
327  const size_t entry_count,
328  const int32_t invalid_slot_val,
329  const size_t key_component_count,
330  const bool with_val_slot,
331  const RangeKeyHandler* key_handler,
332  const size_t num_elems,
333  const int32_t cpu_thread_idx,
334  const int32_t cpu_thread_count);
335 
336 void fill_baseline_hash_join_buff_on_device_32(int8_t* hash_buff,
337  const int64_t entry_count,
338  const int32_t invalid_slot_val,
339  const bool for_semi_join,
340  const size_t key_component_count,
341  const bool with_val_slot,
342  int* dev_err_buff,
343  const GenericKeyHandler* key_handler,
344  const int64_t num_elems);
345 
346 void fill_baseline_hash_join_buff_on_device_64(int8_t* hash_buff,
347  const int64_t entry_count,
348  const int32_t invalid_slot_val,
349  const bool for_semi_join,
350  const size_t key_component_count,
351  const bool with_val_slot,
352  int* dev_err_buff,
353  const GenericKeyHandler* key_handler,
354  const int64_t num_elems);
355 
357  int8_t* hash_buff,
358  const int64_t entry_count,
359  const int32_t invalid_slot_val,
360  const size_t key_component_count,
361  const bool with_val_slot,
362  int* dev_err_buff,
363  const OverlapsKeyHandler* key_handler,
364  const int64_t num_elems);
365 
367  const int64_t entry_count,
368  const int32_t invalid_slot_val,
369  const size_t key_component_count,
370  const bool with_val_slot,
371  int* dev_err_buff,
372  const RangeKeyHandler* key_handler,
373  const size_t num_elems);
374 
376  int32_t* buff,
377  const int32_t* composite_key_dict,
378  const int64_t hash_entry_count,
379  const size_t key_component_count,
380  const std::vector<JoinColumn>& join_column_per_key,
381  const std::vector<JoinColumnTypeInfo>& type_info_per_key,
382  const std::vector<JoinBucketInfo>& join_bucket_info,
383  const std::vector<const int32_t*>& sd_inner_to_outer_translation_maps,
384  const std::vector<int32_t>& sd_min_inner_elems,
385  const int32_t cpu_thread_count,
386  const bool is_range_join = false,
387  const bool is_geo_compressed = false);
388 
390  int32_t* buff,
391  const int64_t* composite_key_dict,
392  const int64_t hash_entry_count,
393  const size_t key_component_count,
394  const std::vector<JoinColumn>& join_column_per_key,
395  const std::vector<JoinColumnTypeInfo>& type_info_per_key,
396  const std::vector<JoinBucketInfo>& join_bucket_info,
397  const std::vector<const int32_t*>& sd_inner_to_outer_translation_maps,
398  const std::vector<int32_t>& sd_min_inner_elems,
399  const int32_t cpu_thread_count,
400  const bool is_range_join = false,
401  const bool is_geo_compressed = false);
402 
404  int32_t* buff,
405  const int32_t* composite_key_dict,
406  const int64_t hash_entry_count,
407  const size_t key_component_count,
408  const GenericKeyHandler* key_handler,
409  const int64_t num_elems);
410 
412  int32_t* buff,
413  const int64_t* composite_key_dict,
414  const int64_t hash_entry_count,
415  const GenericKeyHandler* key_handler,
416  const int64_t num_elems);
417 
419  int32_t* buff,
420  const int64_t* composite_key_dict,
421  const int64_t hash_entry_count,
422  const OverlapsKeyHandler* key_handler,
423  const int64_t num_elems);
424 
426  int32_t* buff,
427  const int64_t* composite_key_dict,
428  const size_t hash_entry_count,
429  const RangeKeyHandler* key_handler,
430  const size_t num_elems);
431 
432 void approximate_distinct_tuples(uint8_t* hll_buffer_all_cpus,
433  const uint32_t b,
434  const size_t padded_size_bytes,
435  const std::vector<JoinColumn>& join_column_per_key,
436  const std::vector<JoinColumnTypeInfo>& type_info_per_key,
437  const int thread_count);
438 
440  uint8_t* hll_buffer_all_cpus,
441  std::vector<int32_t>& row_counts,
442  const uint32_t b,
443  const size_t padded_size_bytes,
444  const std::vector<JoinColumn>& join_column_per_key,
445  const std::vector<JoinColumnTypeInfo>& type_info_per_key,
446  const std::vector<JoinBucketInfo>& join_buckets_per_key,
447  const int thread_count);
448 
450  uint8_t* hll_buffer_all_cpus,
451  std::vector<int32_t>& row_counts,
452  const uint32_t b,
453  const size_t padded_size_bytes,
454  const std::vector<JoinColumn>& join_column_per_key,
455  const std::vector<JoinColumnTypeInfo>& type_info_per_key,
456  const std::vector<JoinBucketInfo>& join_buckets_per_key,
457  const bool is_compressed,
458  const int thread_count);
459 
460 void approximate_distinct_tuples_on_device(uint8_t* hll_buffer,
461  const uint32_t b,
462  const GenericKeyHandler* key_handler,
463  const int64_t num_elems);
464 
465 void approximate_distinct_tuples_on_device_overlaps(uint8_t* hll_buffer,
466  const uint32_t b,
467  int32_t* row_counts_buffer,
468  const OverlapsKeyHandler* key_handler,
469  const int64_t num_elems);
470 
471 void compute_bucket_sizes_on_cpu(std::vector<double>& bucket_sizes_for_dimension,
472  const JoinColumn& join_column,
473  const JoinColumnTypeInfo& type_info,
474  const std::vector<double>& bucket_size_thresholds,
475  const int thread_count);
476 
477 void approximate_distinct_tuples_on_device_range(uint8_t* hll_buffer,
478  const uint32_t b,
479  int32_t* row_counts_buffer,
480  const RangeKeyHandler* key_handler,
481  const size_t num_elems,
482  const size_t block_size_x,
483  const size_t grid_size_x);
484 
485 void compute_bucket_sizes_on_device(double* bucket_sizes_buffer,
486  const JoinColumn* join_column,
487  const JoinColumnTypeInfo* type_info,
488  const double* bucket_size_thresholds);
489 
490 #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:235
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:873
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)