OmniSciDB  2e3a973ef4
anonymous_namespace{JoinHashTableInterface.cpp}::perfect_hash Namespace Reference

Functions

void to_set_one_to_one (const int32_t *const ptr4, size_t entry_count, DecodedJoinHashBufferSet &s)
 
void to_set_one_to_many (const int32_t *const ptr2, const int32_t *const ptr3, const int32_t *const ptr4, size_t entry_count, DecodedJoinHashBufferSet &s)
 

Function Documentation

◆ to_set_one_to_many()

void anonymous_namespace{JoinHashTableInterface.cpp}::perfect_hash::to_set_one_to_many ( const int32_t *const  ptr2,
const int32_t *const  ptr3,
const int32_t *const  ptr4,
size_t  entry_count,
DecodedJoinHashBufferSet s 
)

Definition at line 322 of file JoinHashTableInterface.cpp.

References DecodedJoinHashBufferEntry::key, and DecodedJoinHashBufferEntry::payload.

326  {
327  auto empty = -1;
328  auto ptr = ptr2;
329  for (size_t e = 0; e < entry_count; ++e, ++ptr) {
330  if (*ptr == empty) {
331  continue;
332  }
333 
334  decltype(DecodedJoinHashBufferEntry::key) key;
335  key.push_back(e);
336 
337  int32_t offset = ptr2[e];
338 
339  int32_t count = ptr3[e];
340 
341  decltype(DecodedJoinHashBufferEntry::payload) payload;
342  for (size_t j = 0; j < static_cast<size_t>(count); ++j) {
343  payload.insert(ptr4[offset + j]);
344  }
345 
346  s.insert({std::move(key), std::move(payload)});
347  }
348 }
std::set< int32_t > payload
std::vector< int64_t > key

◆ to_set_one_to_one()

void anonymous_namespace{JoinHashTableInterface.cpp}::perfect_hash::to_set_one_to_one ( const int32_t *const  ptr4,
size_t  entry_count,
DecodedJoinHashBufferSet s 
)

Definition at line 302 of file JoinHashTableInterface.cpp.

References DecodedJoinHashBufferEntry::key, and DecodedJoinHashBufferEntry::payload.

304  {
305  const auto empty = -1;
306  auto ptr = ptr4;
307  for (size_t e = 0; e < entry_count; ++e, ++ptr) {
308  if (*ptr == empty) {
309  continue;
310  }
311 
312  decltype(DecodedJoinHashBufferEntry::key) key;
313  key.push_back(e);
314 
315  decltype(DecodedJoinHashBufferEntry::payload) payload;
316  payload.insert(*ptr);
317 
318  s.insert({std::move(key), std::move(payload)});
319  }
320 }
std::set< int32_t > payload
std::vector< int64_t > key