OmniSciDB
a5dc49c757
|
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include "Geospatial/CompressionRuntime.h"
#include "QueryEngine/CompareKeysInl.h"
#include "QueryEngine/MurmurHash.h"
Go to the source code of this file.
Classes | |
struct | BufferRange |
struct | Bounds |
Namespaces | |
anonymous_namespace{JoinHashTableQueryRuntime.cpp} | |
Functions | |
DEVICE bool | compare_to_key (const int8_t *entry, const int8_t *key, const size_t key_bytes) |
template<class T > | |
DEVICE int64_t | get_matching_slot (const int8_t *hash_buff, const uint32_t h, const int8_t *key, const size_t key_bytes) |
template<class T > | |
FORCE_INLINE DEVICE int64_t | baseline_hash_join_idx_impl (const int8_t *hash_buff, const int8_t *key, const size_t key_bytes, const size_t entry_count) |
RUNTIME_EXPORT NEVER_INLINE DEVICE int64_t | baseline_hash_join_idx_32 (const int8_t *hash_buff, const int8_t *key, const size_t key_bytes, const size_t entry_count) |
RUNTIME_EXPORT NEVER_INLINE DEVICE int64_t | baseline_hash_join_idx_64 (const int8_t *hash_buff, const int8_t *key, const size_t key_bytes, const size_t entry_count) |
template<typename T > | |
FORCE_INLINE DEVICE int64_t | get_bucket_key_for_value_impl (const T value, const double bucket_size) |
RUNTIME_EXPORT NEVER_INLINE DEVICE int64_t | get_bucket_key_for_range_double (const int8_t *range_bytes, const size_t range_component_index, const double bucket_size) |
FORCE_INLINE DEVICE int64_t | get_bucket_key_for_range_compressed_impl (const int8_t *range, const size_t range_component_index, const double bucket_size) |
RUNTIME_EXPORT NEVER_INLINE DEVICE int64_t | get_bucket_key_for_range_compressed (const int8_t *range, const size_t range_component_index, const double bucket_size) |
template<typename T > | |
FORCE_INLINE DEVICE int64_t | get_composite_key_index_impl (const T *key, const size_t key_component_count, const T *composite_key_dict, const size_t entry_count) |
RUNTIME_EXPORT NEVER_INLINE DEVICE int64_t | get_composite_key_index_32 (const int32_t *key, const size_t key_component_count, const int32_t *composite_key_dict, const size_t entry_count) |
RUNTIME_EXPORT NEVER_INLINE DEVICE int64_t | get_composite_key_index_64 (const int64_t *key, const size_t key_component_count, const int64_t *composite_key_dict, const size_t entry_count) |
RUNTIME_EXPORT NEVER_INLINE DEVICE int32_t | insert_sorted (int32_t *arr, size_t elem_count, int32_t elem) |
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t | bbox_intersect_hash_join_idx (int64_t hash_buff, const int64_t key, const int64_t min_key, const int64_t max_key) |
ALWAYS_INLINE DEVICE BufferRange | get_row_id_buffer_ptr (int64_t *hash_table_ptr, const int64_t *key, const int64_t key_component_count, const int64_t entry_count, const int64_t offset_buffer_ptr_offset, const int64_t sub_buff_size) |
RUNTIME_EXPORT NEVER_INLINE DEVICE int64_t | get_candidate_rows (int32_t *out_arr, int32_t *error_code, const uint32_t max_arr_size, const int8_t *range_bytes, const int32_t range_component_index, const double bucket_size_x, const double bucket_size_y, const int32_t keys_count, const int64_t key_component_count, int64_t *hash_table_ptr, const int64_t entry_count, const int64_t offset_buffer_ptr_offset, const int64_t sub_buff_size, const int32_t max_bbox_overlaps_error_code) |
RUNTIME_EXPORT NEVER_INLINE DEVICE int32_t | get_num_buckets_for_bounds (const int8_t *range_bytes, const int32_t range_component_index, const double bucket_size_x, const double bucket_size_y) |
Variables | |
const int | anonymous_namespace{JoinHashTableQueryRuntime.cpp}::kNoMatch = -1 |
const int | anonymous_namespace{JoinHashTableQueryRuntime.cpp}::kNotPresent = -2 |
RUNTIME_EXPORT NEVER_INLINE DEVICE int64_t baseline_hash_join_idx_32 | ( | const int8_t * | hash_buff, |
const int8_t * | key, | ||
const size_t | key_bytes, | ||
const size_t | entry_count | ||
) |
Definition at line 84 of file JoinHashTableQueryRuntime.cpp.
RUNTIME_EXPORT NEVER_INLINE DEVICE int64_t baseline_hash_join_idx_64 | ( | const int8_t * | hash_buff, |
const int8_t * | key, | ||
const size_t | key_bytes, | ||
const size_t | entry_count | ||
) |
Definition at line 92 of file JoinHashTableQueryRuntime.cpp.
FORCE_INLINE DEVICE int64_t baseline_hash_join_idx_impl | ( | const int8_t * | hash_buff, |
const int8_t * | key, | ||
const size_t | key_bytes, | ||
const size_t | entry_count | ||
) |
Definition at line 60 of file JoinHashTableQueryRuntime.cpp.
References anonymous_namespace{JoinHashTableQueryRuntime.cpp}::kNoMatch, and MurmurHash1().
RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t bbox_intersect_hash_join_idx | ( | int64_t | hash_buff, |
const int64_t | key, | ||
const int64_t | min_key, | ||
const int64_t | max_key | ||
) |
Definition at line 203 of file JoinHashTableQueryRuntime.cpp.
Referenced by get_row_id_buffer_ptr().
DEVICE bool compare_to_key | ( | const int8_t * | entry, |
const int8_t * | key, | ||
const size_t | key_bytes | ||
) |
Definition at line 25 of file JoinHashTableQueryRuntime.cpp.
Referenced by get_matching_slot().
RUNTIME_EXPORT NEVER_INLINE DEVICE int64_t get_bucket_key_for_range_compressed | ( | const int8_t * | range, |
const size_t | range_component_index, | ||
const double | bucket_size | ||
) |
Definition at line 130 of file JoinHashTableQueryRuntime.cpp.
References get_bucket_key_for_range_compressed_impl().
FORCE_INLINE DEVICE int64_t get_bucket_key_for_range_compressed_impl | ( | const int8_t * | range, |
const size_t | range_component_index, | ||
const double | bucket_size | ||
) |
Definition at line 114 of file JoinHashTableQueryRuntime.cpp.
References Geospatial::decompress_latitude_coord_geoint32(), Geospatial::decompress_longitude_coord_geoint32(), and get_bucket_key_for_value_impl().
Referenced by get_bucket_key_for_range_compressed().
RUNTIME_EXPORT NEVER_INLINE DEVICE int64_t get_bucket_key_for_range_double | ( | const int8_t * | range_bytes, |
const size_t | range_component_index, | ||
const double | bucket_size | ||
) |
Definition at line 106 of file JoinHashTableQueryRuntime.cpp.
References get_bucket_key_for_value_impl().
FORCE_INLINE DEVICE int64_t get_bucket_key_for_value_impl | ( | const T | value, |
const double | bucket_size | ||
) |
Definition at line 100 of file JoinHashTableQueryRuntime.cpp.
Referenced by get_bucket_key_for_range_compressed_impl(), and get_bucket_key_for_range_double().
RUNTIME_EXPORT NEVER_INLINE DEVICE int64_t get_candidate_rows | ( | int32_t * | out_arr, |
int32_t * | error_code, | ||
const uint32_t | max_arr_size, | ||
const int8_t * | range_bytes, | ||
const int32_t | range_component_index, | ||
const double | bucket_size_x, | ||
const double | bucket_size_y, | ||
const int32_t | keys_count, | ||
const int64_t | key_component_count, | ||
int64_t * | hash_table_ptr, | ||
const int64_t | entry_count, | ||
const int64_t | offset_buffer_ptr_offset, | ||
const int64_t | sub_buff_size, | ||
const int32_t | max_bbox_overlaps_error_code | ||
) |
Getting overlapping candidates for the bounding box intersection algorithm works as follows:
RETURNS: Unique Row IDs are placed on the fixed size stack array that is passed in as out_arr. The number of row ids in this array is returned.
Definition at line 290 of file JoinHashTableQueryRuntime.cpp.
References get_row_id_buffer_ptr(), and insert_sorted().
RUNTIME_EXPORT NEVER_INLINE DEVICE int64_t get_composite_key_index_32 | ( | const int32_t * | key, |
const size_t | key_component_count, | ||
const int32_t * | composite_key_dict, | ||
const size_t | entry_count | ||
) |
Definition at line 162 of file JoinHashTableQueryRuntime.cpp.
References get_composite_key_index_impl().
RUNTIME_EXPORT NEVER_INLINE DEVICE int64_t get_composite_key_index_64 | ( | const int64_t * | key, |
const size_t | key_component_count, | ||
const int64_t * | composite_key_dict, | ||
const size_t | entry_count | ||
) |
Definition at line 171 of file JoinHashTableQueryRuntime.cpp.
References get_composite_key_index_impl().
Referenced by get_row_id_buffer_ptr().
FORCE_INLINE DEVICE int64_t get_composite_key_index_impl | ( | const T * | key, |
const size_t | key_component_count, | ||
const T * | composite_key_dict, | ||
const size_t | entry_count | ||
) |
Definition at line 138 of file JoinHashTableQueryRuntime.cpp.
References get_invalid_key(), keys_are_equal(), MurmurHash1(), SUFFIX, and heavydb.dtypes::T.
Referenced by get_composite_key_index_32(), and get_composite_key_index_64().
DEVICE int64_t get_matching_slot | ( | const int8_t * | hash_buff, |
const uint32_t | h, | ||
const int8_t * | key, | ||
const size_t | key_bytes | ||
) |
Definition at line 44 of file JoinHashTableQueryRuntime.cpp.
References compare_to_key(), get_invalid_key(), anonymous_namespace{JoinHashTableQueryRuntime.cpp}::kNoMatch, anonymous_namespace{JoinHashTableQueryRuntime.cpp}::kNotPresent, SUFFIX, and heavydb.dtypes::T.
RUNTIME_EXPORT NEVER_INLINE DEVICE int32_t get_num_buckets_for_bounds | ( | const int8_t * | range_bytes, |
const int32_t | range_component_index, | ||
const double | bucket_size_x, | ||
const double | bucket_size_y | ||
) |
Definition at line 345 of file JoinHashTableQueryRuntime.cpp.
ALWAYS_INLINE DEVICE BufferRange get_row_id_buffer_ptr | ( | int64_t * | hash_table_ptr, |
const int64_t * | key, | ||
const int64_t | key_component_count, | ||
const int64_t | entry_count, | ||
const int64_t | offset_buffer_ptr_offset, | ||
const int64_t | sub_buff_size | ||
) |
Definition at line 219 of file JoinHashTableQueryRuntime.cpp.
References bbox_intersect_hash_join_idx(), and get_composite_key_index_64().
Referenced by get_candidate_rows().
RUNTIME_EXPORT NEVER_INLINE DEVICE int32_t insert_sorted | ( | int32_t * | arr, |
size_t | elem_count, | ||
int32_t | elem | ||
) |
Definition at line 179 of file JoinHashTableQueryRuntime.cpp.
Referenced by get_candidate_rows().