OmniSciDB  04ee39c94c
OverlapsKeyHandler Struct Reference

#include <HashJoinKeyHandlers.h>

+ Collaboration diagram for OverlapsKeyHandler:

Public Member Functions

 OverlapsKeyHandler (const size_t key_dims_count, const JoinColumn *join_column, const double *bucket_sizes_for_dimension)
 
template<typename T , typename KEY_BUFF_HANDLER >
DEVICE int operator() (const size_t i, T *key_scratch_buff, KEY_BUFF_HANDLER f) const
 

Public Attributes

const size_t key_dims_count_
 
const JoinColumnjoin_column_
 
const double * bucket_sizes_for_dimension_
 

Detailed Description

Definition at line 143 of file HashJoinKeyHandlers.h.

Constructor & Destructor Documentation

◆ OverlapsKeyHandler()

OverlapsKeyHandler::OverlapsKeyHandler ( const size_t  key_dims_count,
const JoinColumn join_column,
const double *  bucket_sizes_for_dimension 
)
inline

Definition at line 144 of file HashJoinKeyHandlers.h.

147  : key_dims_count_(key_dims_count)
148  , join_column_(join_column)
149  , bucket_sizes_for_dimension_(bucket_sizes_for_dimension) {}
const double * bucket_sizes_for_dimension_
const size_t key_dims_count_
const JoinColumn * join_column_

Member Function Documentation

◆ operator()()

template<typename T , typename KEY_BUFF_HANDLER >
DEVICE int OverlapsKeyHandler::operator() ( const size_t  i,
T *  key_scratch_buff,
KEY_BUFF_HANDLER  f 
) const
inline

Definition at line 152 of file HashJoinKeyHandlers.h.

References fixed_width_double_decode_noinline(), and SUFFIX.

152  {
153  // TODO(adb): hard-coding the 2D case w/ bounds for now. Should support n-dims with a
154  // check to ensure we are not exceeding maximum number of dims for coalesced keys
155  double bounds[4];
156  for (size_t j = 0; j < 2 * key_dims_count_; j++) {
158  2 * key_dims_count_ * i + j);
159  }
160 
161  const auto x_bucket_sz = bucket_sizes_for_dimension_[0];
162  const auto y_bucket_sz = bucket_sizes_for_dimension_[1];
163 
164  for (int64_t x = floor(bounds[0] * x_bucket_sz); x <= floor(bounds[2] * x_bucket_sz);
165  x++) {
166  for (int64_t y = floor(bounds[1] * y_bucket_sz);
167  y <= floor(bounds[3] * y_bucket_sz);
168  y++) {
169  key_scratch_buff[0] = x;
170  key_scratch_buff[1] = y;
171 
172  const auto err = f(i, key_scratch_buff, key_dims_count_);
173  if (err) {
174  return err;
175  }
176  }
177  }
178  return 0;
179  }
const int8_t * col_buff
#define SUFFIX(name)
const double * bucket_sizes_for_dimension_
DEVICE NEVER_INLINE double SUFFIX() fixed_width_double_decode_noinline(const int8_t *byte_stream, const int64_t pos)
Definition: DecodersImpl.h:126
const size_t key_dims_count_
const JoinColumn * join_column_
+ Here is the call graph for this function:

Member Data Documentation

◆ bucket_sizes_for_dimension_

const double* OverlapsKeyHandler::bucket_sizes_for_dimension_

Definition at line 183 of file HashJoinKeyHandlers.h.

◆ join_column_

const JoinColumn* OverlapsKeyHandler::join_column_

Definition at line 182 of file HashJoinKeyHandlers.h.

◆ key_dims_count_

const size_t OverlapsKeyHandler::key_dims_count_

Definition at line 181 of file HashJoinKeyHandlers.h.


The documentation for this struct was generated from the following file: