OmniSciDB  06b3bd477c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JoinColumnIterator Struct Reference

Iterates over the rows of a JoinColumn across multiple fragments/chunks. More...

#include <JoinColumnIterator.h>

+ Collaboration diagram for JoinColumnIterator:

Classes

struct  IndexedElement
 

Public Member Functions

DEVICE FORCE_INLINE operator bool () const
 
DEVICE FORCE_INLINE const int8_t * ptr () const
 
DEVICE FORCE_INLINE int64_t getElementSwitch () const
 
DEVICE FORCE_INLINE IndexedElement operator* () const
 
DEVICE FORCE_INLINE
JoinColumnIterator
operator++ ()
 
DEVICE JoinColumnIterator ()
 
DEVICE JoinColumnIterator (const JoinColumn *join_column, const JoinColumnTypeInfo *type_info, size_t start, size_t step)
 

Public Attributes

const JoinColumnjoin_column
 
const JoinColumnTypeInfotype_info
 
struct JoinChunkjoin_chunk_array
 
const int8_t * chunk_data
 
size_t index_of_chunk
 
size_t index_inside_chunk
 
size_t index
 
size_t start
 
size_t step
 

Detailed Description

Iterates over the rows of a JoinColumn across multiple fragments/chunks.

Definition at line 20 of file JoinColumnIterator.h.

Constructor & Destructor Documentation

DEVICE JoinColumnIterator::JoinColumnIterator ( )
inline

Definition at line 89 of file JoinColumnIterator.h.

89 : chunk_data(nullptr) {}
const int8_t * chunk_data
DEVICE JoinColumnIterator::JoinColumnIterator ( const JoinColumn join_column,
const JoinColumnTypeInfo type_info,
size_t  start,
size_t  step 
)
inline

Definition at line 91 of file JoinColumnIterator.h.

References operator++(), start, and step.

96  : join_column(join_column)
97  , type_info(type_info)
99  reinterpret_cast<const struct JoinChunk*>(join_column->col_chunks_buff))
100  , chunk_data(join_column->num_elems > 0 ? join_chunk_array->col_buff : nullptr)
101  , index_of_chunk(0)
102  , index_inside_chunk(0)
103  , index(0)
104  , start(start)
105  , step(step) {
106  // Stagger the index differently for each thread iterating over the column.
107  auto temp = this->step;
108  this->step = this->start;
109  operator++();
110  this->step = temp;
111  }
const int8_t * chunk_data
struct JoinChunk * join_chunk_array
size_t num_elems
const int8_t * col_buff
const JoinColumn * join_column
const int8_t * col_chunks_buff
DEVICE FORCE_INLINE JoinColumnIterator & operator++()
const JoinColumnTypeInfo * type_info

+ Here is the call graph for this function:

Member Function Documentation

DEVICE FORCE_INLINE int64_t JoinColumnIterator::getElementSwitch ( ) const
inline

Definition at line 37 of file JoinColumnIterator.h.

References assert(), CHECK(), chunk_data, JoinColumnTypeInfo::column_type, Double, JoinColumnTypeInfo::elem_sz, fixed_width_double_decode_noinline(), fixed_width_int_decode_noinline(), fixed_width_small_date_decode_noinline(), fixed_width_unsigned_decode_noinline(), index_inside_chunk, NULL_INT, NULL_SMALLINT, Signed, SmallDate, SUFFIX, type_info, and Unsigned.

Referenced by operator*().

37  {
38  switch (type_info->column_type) {
39  case SmallDate:
41  chunk_data,
46  case Signed:
49  case Unsigned:
52  case Double:
54  default:
55 #ifndef __CUDACC__
56  CHECK(false);
57 #else
58  assert(0);
59 #endif
60  return 0;
61  }
62  }
const int8_t * chunk_data
const ColumnType column_type
DEVICE NEVER_INLINE int64_t SUFFIX() fixed_width_int_decode_noinline(const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
Definition: DecodersImpl.h:83
const size_t elem_sz
#define SUFFIX(name)
CHECK(cgen_state)
DEVICE NEVER_INLINE int64_t SUFFIX() fixed_width_unsigned_decode_noinline(const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
Definition: DecodersImpl.h:90
#define NULL_INT
Definition: sqltypes.h:182
DEVICE NEVER_INLINE int64_t SUFFIX() fixed_width_small_date_decode_noinline(const int8_t *byte_stream, const int32_t byte_width, const int32_t null_val, const int64_t ret_null_val, const int64_t pos)
Definition: DecodersImpl.h:141
int64_t const int32_t sz assert(dest)
#define NULL_SMALLINT
Definition: sqltypes.h:181
DEVICE NEVER_INLINE double SUFFIX() fixed_width_double_decode_noinline(const int8_t *byte_stream, const int64_t pos)
Definition: DecodersImpl.h:126
const JoinColumnTypeInfo * type_info

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE FORCE_INLINE JoinColumnIterator::operator bool ( ) const
inline

Definition at line 31 of file JoinColumnIterator.h.

References chunk_data.

31 { return chunk_data; }
const int8_t * chunk_data
DEVICE FORCE_INLINE IndexedElement JoinColumnIterator::operator* ( ) const
inline

Definition at line 69 of file JoinColumnIterator.h.

References getElementSwitch(), and index.

69  {
70  return {index, getElementSwitch()};
71  }
DEVICE FORCE_INLINE int64_t getElementSwitch() const

+ Here is the call graph for this function:

DEVICE FORCE_INLINE JoinColumnIterator& JoinColumnIterator::operator++ ( void  )
inline

Definition at line 73 of file JoinColumnIterator.h.

References chunk_data, JoinChunk::col_buff, index, index_inside_chunk, index_of_chunk, join_chunk_array, JoinChunk::num_elems, and step.

Referenced by JoinColumnIterator().

73  {
74  index += step;
76  while (chunk_data &&
80  if (index_of_chunk < join_column->num_chunks) {
82  } else {
83  chunk_data = nullptr;
84  }
85  }
86  return *this;
87  }
const int8_t * chunk_data
struct JoinChunk * join_chunk_array
const int8_t * col_buff
size_t num_elems

+ Here is the caller graph for this function:

DEVICE FORCE_INLINE const int8_t* JoinColumnIterator::ptr ( ) const
inline

Definition at line 33 of file JoinColumnIterator.h.

References chunk_data, JoinColumn::elem_sz, index_inside_chunk, and join_column.

Referenced by compute_bucket_sizes_impl(), and OverlapsKeyHandler::operator()().

33  {
35  }
const int8_t * chunk_data
const JoinColumn * join_column

+ Here is the caller graph for this function:

Member Data Documentation

const int8_t* JoinColumnIterator::chunk_data

Definition at line 24 of file JoinColumnIterator.h.

Referenced by getElementSwitch(), operator bool(), operator++(), and ptr().

size_t JoinColumnIterator::index

Definition at line 27 of file JoinColumnIterator.h.

Referenced by operator*(), and operator++().

size_t JoinColumnIterator::index_inside_chunk

Definition at line 26 of file JoinColumnIterator.h.

Referenced by getElementSwitch(), operator++(), and ptr().

size_t JoinColumnIterator::index_of_chunk

Definition at line 25 of file JoinColumnIterator.h.

Referenced by operator++().

struct JoinChunk* JoinColumnIterator::join_chunk_array

Definition at line 23 of file JoinColumnIterator.h.

Referenced by operator++().

const JoinColumn* JoinColumnIterator::join_column

Definition at line 21 of file JoinColumnIterator.h.

Referenced by ptr().

size_t JoinColumnIterator::start

Definition at line 28 of file JoinColumnIterator.h.

Referenced by JoinColumnIterator().

size_t JoinColumnIterator::step

Definition at line 29 of file JoinColumnIterator.h.

Referenced by JoinColumnIterator(), and operator++().

const JoinColumnTypeInfo* JoinColumnIterator::type_info

Definition at line 22 of file JoinColumnIterator.h.

Referenced by getElementSwitch().


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