OmniSciDB  06b3bd477c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 129 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 130 of file HashJoinKeyHandlers.h.

133  : key_dims_count_(key_dims_count)
134  , join_column_(join_column)
135  , 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 176 of file HashJoinKeyHandlers.h.

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

Definition at line 174 of file HashJoinKeyHandlers.h.

References join_column_.

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

Definition at line 172 of file HashJoinKeyHandlers.h.

References key_dims_count_.

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

Definition at line 170 of file HashJoinKeyHandlers.h.

170 { 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 138 of file HashJoinKeyHandlers.h.

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

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

Referenced by operator()().

const JoinColumn* OverlapsKeyHandler::join_column_

Definition at line 179 of file HashJoinKeyHandlers.h.

Referenced by get_join_columns().

const size_t OverlapsKeyHandler::key_dims_count_

Definition at line 178 of file HashJoinKeyHandlers.h.

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


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