OmniSciDB  eb3a3d0a03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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() (JoinColumnIterator *join_column_iterators, T *key_scratch_buff, KEY_BUFF_HANDLER f) const
 
DEVICE size_t get_number_of_columns () const
 
DEVICE size_t get_key_component_count () const
 
DEVICE const JoinColumnget_join_columns () const
 
DEVICE const JoinColumnTypeInfoget_join_column_type_infos () const
 

Public Attributes

const size_t key_dims_count_
 
const JoinColumnjoin_column_
 
const double * bucket_sizes_for_dimension_
 

Detailed Description

Definition at line 131 of file HashJoinKeyHandlers.h.

Constructor & Destructor Documentation

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

Definition at line 132 of file HashJoinKeyHandlers.h.

135  : key_dims_count_(key_dims_count)
136  , join_column_(join_column)
137  , 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

DEVICE const JoinColumnTypeInfo* OverlapsKeyHandler::get_join_column_type_infos ( ) const
inline

Definition at line 178 of file HashJoinKeyHandlers.h.

178 { return nullptr; }
DEVICE const JoinColumn* OverlapsKeyHandler::get_join_columns ( ) const
inline

Definition at line 176 of file HashJoinKeyHandlers.h.

References join_column_.

176 { return join_column_; }
const JoinColumn * join_column_
DEVICE size_t OverlapsKeyHandler::get_key_component_count ( ) const
inline

Definition at line 174 of file HashJoinKeyHandlers.h.

References key_dims_count_.

174 { return key_dims_count_; }
const size_t key_dims_count_
DEVICE size_t OverlapsKeyHandler::get_number_of_columns ( ) const
inline

Definition at line 172 of file HashJoinKeyHandlers.h.

172 { return 1; }
template<typename T , typename KEY_BUFF_HANDLER >
DEVICE int OverlapsKeyHandler::operator() ( JoinColumnIterator join_column_iterators,
T *  key_scratch_buff,
KEY_BUFF_HANDLER  f 
) const
inline

Definition at line 140 of file HashJoinKeyHandlers.h.

References bucket_sizes_for_dimension_, f, fixed_width_double_decode_noinline(), key_dims_count_, JoinColumnIterator::ptr(), and SUFFIX.

142  {
143  // TODO(adb): hard-coding the 2D case w/ bounds for now. Should support n-dims with a
144  // check to ensure we are not exceeding maximum number of dims for coalesced keys
145  double bounds[4];
146  for (size_t j = 0; j < 2 * key_dims_count_; j++) {
147  bounds[j] =
148  SUFFIX(fixed_width_double_decode_noinline)(join_column_iterators->ptr(), j);
149  }
150 
151  const auto x_bucket_sz = bucket_sizes_for_dimension_[0];
152  const auto y_bucket_sz = bucket_sizes_for_dimension_[1];
153 
154  for (int64_t x = floor(bounds[0] * x_bucket_sz); x <= floor(bounds[2] * x_bucket_sz);
155  x++) {
156  for (int64_t y = floor(bounds[1] * y_bucket_sz);
157  y <= floor(bounds[3] * y_bucket_sz);
158  y++) {
159  key_scratch_buff[0] = x;
160  key_scratch_buff[1] = y;
161 
162  const auto err =
163  f(join_column_iterators[0].index, key_scratch_buff, key_dims_count_);
164  if (err) {
165  return err;
166  }
167  }
168  }
169  return 0;
170  }
#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:134
char * f
DEVICE FORCE_INLINE const int8_t * ptr() const
const size_t key_dims_count_

+ Here is the call graph for this function:

Member Data Documentation

const double* OverlapsKeyHandler::bucket_sizes_for_dimension_

Definition at line 182 of file HashJoinKeyHandlers.h.

Referenced by operator()().

const JoinColumn* OverlapsKeyHandler::join_column_

Definition at line 181 of file HashJoinKeyHandlers.h.

Referenced by get_join_columns().

const size_t OverlapsKeyHandler::key_dims_count_

Definition at line 180 of file HashJoinKeyHandlers.h.

Referenced by get_key_component_count(), and operator()().


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