OmniSciDB  471d68cefb
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{HashTable.cpp}::keyed_hash Namespace Reference

Functions

template<typename T >
void to_set_one_to_one (const int8_t *ptr1, size_t entry_count, size_t key_component_count, DecodedJoinHashBufferSet &s)
 
template<typename T >
void to_set_one_to_many (const int8_t *ptr1, const int32_t *const ptr2, const int32_t *const ptr3, const int32_t *const ptr4, size_t entry_count, size_t key_component_count, DecodedJoinHashBufferSet &s)
 

Function Documentation

template<typename T >
void anonymous_namespace{HashTable.cpp}::keyed_hash::to_set_one_to_many ( const int8_t *  ptr1,
const int32_t *const  ptr2,
const int32_t *const  ptr3,
const int32_t *const  ptr4,
size_t  entry_count,
size_t  key_component_count,
DecodedJoinHashBufferSet s 
)

Definition at line 101 of file HashTable.cpp.

References count, DecodedJoinHashBufferEntry::payload, and omnisci.dtypes::T.

107  {
108  auto empty = get_empty_key<T>();
109  auto ptr = reinterpret_cast<const T*>(ptr1);
110  for (size_t e = 0; e < entry_count; ++e, ptr += key_component_count) {
111  if (*ptr == empty) {
112  continue;
113  }
114 
115  std::vector<int64_t> key;
116  size_t j = 0;
117  for (; j < key_component_count - 1; ++j) {
118  key.push_back(ptr[j]);
119  }
120 
121  int32_t offset = ptr2[e];
122 
123  int32_t count = ptr3[e];
124 
125  decltype(DecodedJoinHashBufferEntry::payload) payload;
126  for (size_t j = 0; j < static_cast<size_t>(count); ++j) {
127  payload.insert(ptr4[offset + j]);
128  }
129 
130  s.insert({std::move(key), std::move(payload)});
131  }
132 }
int count
std::set< int32_t > payload
Definition: HashTable.h:23
template<typename T >
void anonymous_namespace{HashTable.cpp}::keyed_hash::to_set_one_to_one ( const int8_t *  ptr1,
size_t  entry_count,
size_t  key_component_count,
DecodedJoinHashBufferSet s 
)

Definition at line 76 of file HashTable.cpp.

References omnisci.dtypes::T.

79  {
80  auto empty = get_empty_key<T>();
81  auto ptr = reinterpret_cast<const T*>(ptr1);
82  for (size_t e = 0; e < entry_count; ++e, ptr += key_component_count) {
83  if (*ptr == empty) {
84  continue;
85  }
86 
87  std::vector<int64_t> key;
88  size_t j = 0;
89  for (; j < key_component_count - 1; ++j) {
90  key.push_back(ptr[j]);
91  }
92 
93  std::set<int32_t> payload;
94  payload.insert(ptr[j]);
95 
96  s.insert({std::move(key), std::move(payload)});
97  }
98 }