OmniSciDB  a47db9e897
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{JoinHashTableInterface.cpp} Namespace Reference

Functions

template<typename T >
void innerDecodeJoinHashBufferToString (const int8_t *ptr1, size_t entry_count, size_t key_component_count, bool raw, std::string &txt)
 
template<typename T >
std::string decodeJoinHashBufferToStringFlat (const JoinHashTableInterface *hash_table, const ExecutorDeviceType device_type, const int device_id) noexcept
 
template<typename T >
void innerDecodeJoinHashBuffer (const int8_t *ptr1, const int32_t *ptr2, const int32_t *ptr3, const int32_t *ptr4, size_t entry_count, size_t key_component_count, std::set< DecodedJoinHashBufferEntry > &s)
 
template<typename T >
void innerDecodeJoinHashBuffer (const int32_t *ptr2, const int32_t *ptr3, const int32_t *ptr4, size_t entry_count, std::set< DecodedJoinHashBufferEntry > &s)
 

Function Documentation

template<typename T >
std::string anonymous_namespace{JoinHashTableInterface.cpp}::decodeJoinHashBufferToStringFlat ( const JoinHashTableInterface hash_table,
const ExecutorDeviceType  device_type,
const int  device_id 
)
noexcept

Definition at line 141 of file JoinHashTableInterface.cpp.

References to_string().

143  {
144  auto mem =
145  reinterpret_cast<const T*>(hash_table->getJoinHashBuffer(device_type, device_id));
146  auto memsz = hash_table->getJoinHashBufferSize(device_type, device_id) / sizeof(T);
147  std::string txt;
148  for (size_t i = 0; i < memsz; ++i) {
149  if (i > 0) {
150  txt += ", ";
151  }
152  txt += std::to_string(mem[i]);
153  }
154  return txt;
155 }
virtual int64_t getJoinHashBuffer(const ExecutorDeviceType device_type, const int device_id) const noexcept=0
virtual size_t getJoinHashBufferSize(const ExecutorDeviceType device_type, const int device_id) const noexcept=0
std::string to_string(char const *&&v)

+ Here is the call graph for this function:

template<typename T >
void anonymous_namespace{JoinHashTableInterface.cpp}::innerDecodeJoinHashBuffer ( const int8_t *  ptr1,
const int32_t *  ptr2,
const int32_t *  ptr3,
const int32_t *  ptr4,
size_t  entry_count,
size_t  key_component_count,
std::set< DecodedJoinHashBufferEntry > &  s 
)

Definition at line 205 of file JoinHashTableInterface.cpp.

211  {
212  auto empty = get_empty_key<T>();
213  auto ptr = reinterpret_cast<const T*>(ptr1);
214  for (size_t e = 0; e < entry_count; ++e, ptr += key_component_count) {
215  if (*ptr == empty) {
216  continue;
217  }
218 
219  std::vector<int64_t> key;
220  for (size_t j = 0; j < key_component_count; ++j) {
221  key.push_back(ptr[j]);
222  }
223 
224  int32_t offset = ptr2[e];
225 
226  int32_t count = ptr3[e];
227 
228  std::set<int32_t> payload;
229  for (size_t j = 0; j < static_cast<size_t>(count); ++j) {
230  payload.insert(ptr4[offset + j]);
231  }
232 
233  s.insert({std::move(key), std::move(payload)});
234  }
235 }
template<typename T >
void anonymous_namespace{JoinHashTableInterface.cpp}::innerDecodeJoinHashBuffer ( const int32_t *  ptr2,
const int32_t *  ptr3,
const int32_t *  ptr4,
size_t  entry_count,
std::set< DecodedJoinHashBufferEntry > &  s 
)

Definition at line 238 of file JoinHashTableInterface.cpp.

242  {
243  auto empty = -1;
244  auto ptr = reinterpret_cast<const T*>(ptr2);
245  for (size_t e = 0; e < entry_count; ++e, ++ptr) {
246  if (*ptr == empty) {
247  continue;
248  }
249 
250  std::vector<int64_t> key;
251  key.push_back(e);
252 
253  int32_t offset = ptr2[e];
254 
255  int32_t count = ptr3[e];
256 
257  std::set<int32_t> payload;
258  for (size_t j = 0; j < static_cast<size_t>(count); ++j) {
259  payload.insert(ptr4[offset + j]);
260  }
261 
262  s.insert({std::move(key), std::move(payload)});
263  }
264 }
template<typename T >
void anonymous_namespace{JoinHashTableInterface.cpp}::innerDecodeJoinHashBufferToString ( const int8_t *  ptr1,
size_t  entry_count,
size_t  key_component_count,
bool  raw,
std::string &  txt 
)

Definition at line 23 of file JoinHashTableInterface.cpp.

References to_string().

27  {
28  auto empty = get_empty_key<T>();
29  auto ptr = reinterpret_cast<const T*>(ptr1);
30  for (size_t e = 0; e < entry_count; ++e, ptr += key_component_count) {
31  if (e != 0) {
32  txt += " ";
33  }
34  if (*ptr == empty && !raw) {
35  txt += "*"; // null hash table entry
36  } else if (*ptr == empty - 1 && !raw) {
37  txt += "?"; // write_pending (should never happen here)
38  } else {
39  txt += "(";
40  for (size_t j = 0; j < key_component_count; ++j) {
41  if (j != 0) {
42  txt += ",";
43  }
44  txt += std::to_string(ptr[j]);
45  }
46  txt += ")";
47  }
48  }
49 }
std::string to_string(char const *&&v)

+ Here is the call graph for this function: