OmniSciDB  c0231cc57d
 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 127 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 128 of file HashJoinKeyHandlers.h.

131  : key_dims_count_(key_dims_count)
132  , join_column_(join_column)
133  , 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 174 of file HashJoinKeyHandlers.h.

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

Definition at line 172 of file HashJoinKeyHandlers.h.

References join_column_.

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

Definition at line 170 of file HashJoinKeyHandlers.h.

References key_dims_count_.

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

Definition at line 168 of file HashJoinKeyHandlers.h.

168 { 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 136 of file HashJoinKeyHandlers.h.

References bucket_sizes_for_dimension_, anonymous_namespace{Utm.h}::f, fixed_width_double_decode_noinline(), key_dims_count_, JoinColumnIterator::ptr(), and SUFFIX.

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

Referenced by operator()().

const JoinColumn* OverlapsKeyHandler::join_column_

Definition at line 177 of file HashJoinKeyHandlers.h.

Referenced by get_join_columns().

const size_t OverlapsKeyHandler::key_dims_count_

Definition at line 176 of file HashJoinKeyHandlers.h.

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


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