OmniSciDB  d2f719934e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ColSlotContext Class Reference

#include <ColSlotContext.h>

Public Member Functions

 ColSlotContext ()
 
 ColSlotContext (const std::vector< Analyzer::Expr * > &col_expr_list, const std::vector< int64_t > &col_exprs_to_not_project)
 
void setAllSlotsSize (const int8_t slot_width_size)
 
void setAllSlotsPaddedSize (const int8_t padded_size)
 
void setAllUnsetSlotsPaddedSize (const int8_t padded_size)
 
void setAllSlotsPaddedSizeToLogicalSize ()
 
void validate () const
 
size_t getColCount () const
 
size_t getSlotCount () const
 
const SlotSizegetSlotInfo (const size_t slot_idx) const
 
void setPaddedSlotWidthBytes (const size_t slot_idx, const int8_t bytes)
 
const std::vector< size_t > & getSlotsForCol (const size_t col_idx) const
 
size_t getAllSlotsPaddedSize () const
 
size_t getAllSlotsAlignedPaddedSize () const
 
size_t getAlignedPaddedSizeForRange (const size_t end) const
 
size_t getTotalBytesOfColumnarBuffers (const size_t entry_count) const
 
int8_t getMinPaddedByteSize (const int8_t actual_min_byte_width) const
 
size_t getCompactByteWidth () const
 
size_t getColOnlyOffInBytes (const size_t slot_idx) const
 
bool empty ()
 
void clear ()
 
void addColumn (const std::vector< std::tuple< int8_t, int8_t >> &slots_for_col)
 
bool operator== (const ColSlotContext &that) const
 
bool operator!= (const ColSlotContext &that) const
 
void alignPaddedSlots (const bool sort_on_gpu)
 
int64_t varlenOutputElementSize (const size_t slot_idx) const
 
bool hasVarlenOutput () const
 
bool slotIsVarlen (const size_t slot_idx) const
 
std::string toString () const
 

Private Types

using ArraySize = int64_t
 
using SlotIndex = size_t
 

Private Member Functions

void addSlotForColumn (const int8_t logical_size, const size_t column_idx)
 
void addSlotForColumn (const int8_t padded_size, const int8_t logical_size, const size_t column_idx)
 

Private Attributes

std::vector< SlotSizeslot_sizes_
 
std::vector< std::vector
< size_t > > 
col_to_slot_map_
 
std::unordered_map< SlotIndex,
ArraySize
varlen_output_slot_map_
 

Detailed Description

Definition at line 47 of file ColSlotContext.h.

Member Typedef Documentation

using ColSlotContext::ArraySize = int64_t
private

Definition at line 147 of file ColSlotContext.h.

using ColSlotContext::SlotIndex = size_t
private

Definition at line 148 of file ColSlotContext.h.

Constructor & Destructor Documentation

ColSlotContext::ColSlotContext ( )
inline

Definition at line 49 of file ColSlotContext.h.

49 {}
ColSlotContext::ColSlotContext ( const std::vector< Analyzer::Expr * > &  col_expr_list,
const std::vector< int64_t > &  col_exprs_to_not_project 
)

Definition at line 37 of file ColSlotContext.cpp.

References addSlotForColumn(), CHECK, CHECK_EQ, col_to_slot_map_, g_bigint_count, get_bit_width(), get_compact_type(), get_target_info(), i, kAVG, kENCODING_GEOINT, kENCODING_NONE, kPOINT, slot_sizes_, and varlen_output_slot_map_.

38  {
39  // Note that non-projected col exprs could be projected cols that we can lazy fetch or
40  // grouped cols with keyless hash
41  if (!col_exprs_to_not_project.empty()) {
42  CHECK_EQ(col_expr_list.size(), col_exprs_to_not_project.size());
43  }
44  size_t col_expr_idx = 0;
45  col_to_slot_map_.resize(col_expr_list.size());
46  for (const auto col_expr : col_expr_list) {
47  if (!col_exprs_to_not_project.empty() &&
48  col_exprs_to_not_project[col_expr_idx] != -1) {
49  addSlotForColumn(0, 0, col_expr_idx);
50  ++col_expr_idx;
51  continue;
52  }
53  if (!col_expr) {
54  // row index
55  addSlotForColumn(sizeof(int64_t), col_expr_idx);
56  } else {
57  const auto agg_info = get_target_info(col_expr, g_bigint_count);
58  const auto chosen_type = get_compact_type(agg_info);
59 
60  if ((chosen_type.is_string() && chosen_type.get_compression() == kENCODING_NONE) ||
61  chosen_type.is_array()) {
62  addSlotForColumn(sizeof(int64_t), col_expr_idx);
63  addSlotForColumn(sizeof(int64_t), col_expr_idx);
64  ++col_expr_idx;
65  continue;
66  }
67  if (chosen_type.is_geometry()) {
68  if (dynamic_cast<const Analyzer::GeoExpr*>(col_expr)) {
69  CHECK_EQ(chosen_type.get_type(), kPOINT);
70  // Pointer/offset into varlen buffer
71  addSlotForColumn(sizeof(int64_t), col_expr_idx);
72  const int64_t arr_size =
73  chosen_type.get_compression() == kENCODING_GEOINT ? 8 : 16;
75  .insert(std::make_pair(slot_sizes_.size() - 1, arr_size))
76  .second);
77  } else {
78  for (auto i = 0; i < chosen_type.get_physical_coord_cols(); ++i) {
79  addSlotForColumn(sizeof(int64_t), col_expr_idx);
80  addSlotForColumn(sizeof(int64_t), col_expr_idx);
81  }
82  }
83  ++col_expr_idx;
84  continue;
85  }
86 
87  const auto col_expr_bitwidth = get_bit_width(chosen_type);
88 
89  CHECK_EQ(size_t(0), col_expr_bitwidth % 8);
90  addSlotForColumn(static_cast<int8_t>(col_expr_bitwidth >> 3), col_expr_idx);
91  // for average, we'll need to keep the count as well
92  if (agg_info.agg_kind == kAVG) {
93  CHECK(agg_info.is_agg);
94  addSlotForColumn(sizeof(int64_t), col_expr_idx);
95  }
96  }
97  ++col_expr_idx;
98  }
99 }
#define CHECK_EQ(x, y)
Definition: Logger.h:219
std::unordered_map< SlotIndex, ArraySize > varlen_output_slot_map_
TargetInfo get_target_info(const PointerType target_expr, const bool bigint_count)
Definition: TargetInfo.h:92
std::vector< std::vector< size_t > > col_to_slot_map_
std::vector< SlotSize > slot_sizes_
const SQLTypeInfo get_compact_type(const TargetInfo &target)
size_t get_bit_width(const SQLTypeInfo &ti)
bool g_bigint_count
void addSlotForColumn(const int8_t logical_size, const size_t column_idx)
#define CHECK(condition)
Definition: Logger.h:211
Definition: sqldefs.h:72

+ Here is the call graph for this function:

Member Function Documentation

void ColSlotContext::addColumn ( const std::vector< std::tuple< int8_t, int8_t >> &  slots_for_col)

Definition at line 261 of file ColSlotContext.cpp.

References addSlotForColumn(), and col_to_slot_map_.

Referenced by QueryMemoryDescriptor::addColSlotInfo().

262  {
263  const auto col_idx = col_to_slot_map_.size();
264  col_to_slot_map_.emplace_back();
265  for (const auto& slot_info : slots_for_col) {
266  addSlotForColumn(std::get<1>(slot_info), std::get<0>(slot_info), col_idx);
267  }
268 }
std::vector< std::vector< size_t > > col_to_slot_map_
void addSlotForColumn(const int8_t logical_size, const size_t column_idx)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ColSlotContext::addSlotForColumn ( const int8_t  logical_size,
const size_t  column_idx 
)
private

Definition at line 270 of file ColSlotContext.cpp.

Referenced by addColumn(), and ColSlotContext().

271  {
272  addSlotForColumn(-1, logical_size, column_idx);
273 }
void addSlotForColumn(const int8_t logical_size, const size_t column_idx)

+ Here is the caller graph for this function:

void ColSlotContext::addSlotForColumn ( const int8_t  padded_size,
const int8_t  logical_size,
const size_t  column_idx 
)
private

Definition at line 275 of file ColSlotContext.cpp.

References CHECK_LT, col_to_slot_map_, and slot_sizes_.

277  {
278  CHECK_LT(column_idx, col_to_slot_map_.size());
279  col_to_slot_map_[column_idx].push_back(slot_sizes_.size());
280  slot_sizes_.emplace_back(SlotSize{padded_size, logical_size});
281 }
std::vector< std::vector< size_t > > col_to_slot_map_
std::vector< SlotSize > slot_sizes_
#define CHECK_LT(x, y)
Definition: Logger.h:221
void ColSlotContext::alignPaddedSlots ( const bool  sort_on_gpu)

Definition at line 236 of file ColSlotContext.cpp.

References align_to_int64(), CHECK, CHECK_GE, and slot_sizes_.

Referenced by QueryMemoryDescriptor::alignPaddedSlots().

236  {
237  size_t total_bytes{0};
238  for (size_t slot_idx = 0; slot_idx < slot_sizes_.size(); slot_idx++) {
239  auto chosen_bytes = slot_sizes_[slot_idx].padded_size;
240  if (chosen_bytes == sizeof(int64_t)) {
241  const auto aligned_total_bytes = align_to_int64(total_bytes);
242  CHECK_GE(aligned_total_bytes, total_bytes);
243  if (slot_idx >= 1) {
244  const auto padding = aligned_total_bytes - total_bytes;
245  CHECK(padding == 0 || padding == 4);
246  slot_sizes_[slot_idx - 1].padded_size += padding;
247  }
248  total_bytes = aligned_total_bytes;
249  }
250  total_bytes += chosen_bytes;
251  }
252  if (!sort_on_gpu) {
253  const auto aligned_total_bytes = align_to_int64(total_bytes);
254  CHECK_GE(aligned_total_bytes, total_bytes);
255  const auto padding = aligned_total_bytes - total_bytes;
256  CHECK(padding == 0 || padding == 4);
257  slot_sizes_.back().padded_size += padding;
258  }
259 }
#define CHECK_GE(x, y)
Definition: Logger.h:224
std::vector< SlotSize > slot_sizes_
#define CHECK(condition)
Definition: Logger.h:211
void sort_on_gpu(int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, const bool desc, const uint32_t chosen_bytes, ThrustAllocator &alloc)
FORCE_INLINE HOST DEVICE T align_to_int64(T addr)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ColSlotContext::clear ( )

Definition at line 231 of file ColSlotContext.cpp.

References col_to_slot_map_, and slot_sizes_.

Referenced by QueryMemoryDescriptor::clearSlotInfo().

231  {
232  slot_sizes_.clear();
233  col_to_slot_map_.clear();
234 }
std::vector< std::vector< size_t > > col_to_slot_map_
std::vector< SlotSize > slot_sizes_

+ Here is the caller graph for this function:

bool ColSlotContext::empty ( )

Definition at line 227 of file ColSlotContext.cpp.

References slot_sizes_.

227  {
228  return slot_sizes_.empty();
229 }
std::vector< SlotSize > slot_sizes_
size_t ColSlotContext::getAlignedPaddedSizeForRange ( const size_t  end) const

Definition at line 154 of file ColSlotContext.cpp.

References gpu_enabled::accumulate(), align_to_int64(), CHECK_GE, and slot_sizes_.

Referenced by getAllSlotsAlignedPaddedSize(), and getColOnlyOffInBytes().

154  {
155  return std::accumulate(slot_sizes_.cbegin(),
156  slot_sizes_.cbegin() + end,
157  size_t(0),
158  [](size_t sum, const auto& slot_size) {
159  CHECK_GE(slot_size.padded_size, 0);
160  const auto chosen_bytes =
161  static_cast<size_t>(slot_size.padded_size);
162  if (chosen_bytes == sizeof(int64_t)) {
163  return align_to_int64(sum) + chosen_bytes;
164  } else {
165  return sum + chosen_bytes;
166  }
167  });
168 }
#define CHECK_GE(x, y)
Definition: Logger.h:224
std::vector< SlotSize > slot_sizes_
DEVICE auto accumulate(ARGS &&...args)
Definition: gpu_enabled.h:42
FORCE_INLINE HOST DEVICE T align_to_int64(T addr)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t ColSlotContext::getAllSlotsAlignedPaddedSize ( ) const

Definition at line 150 of file ColSlotContext.cpp.

References getAlignedPaddedSizeForRange(), and slot_sizes_.

Referenced by QueryMemoryDescriptor::getColsSize().

150  {
152 }
std::vector< SlotSize > slot_sizes_
size_t getAlignedPaddedSizeForRange(const size_t end) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t ColSlotContext::getAllSlotsPaddedSize ( ) const

Definition at line 140 of file ColSlotContext.cpp.

References gpu_enabled::accumulate(), CHECK_GE, and slot_sizes_.

Referenced by QueryMemoryDescriptor::getRowWidth().

140  {
141  return std::accumulate(slot_sizes_.cbegin(),
142  slot_sizes_.cend(),
143  size_t(0),
144  [](size_t sum, const auto& slot_size) {
145  CHECK_GE(slot_size.padded_size, 0);
146  return sum + static_cast<size_t>(slot_size.padded_size);
147  });
148 }
#define CHECK_GE(x, y)
Definition: Logger.h:224
std::vector< SlotSize > slot_sizes_
DEVICE auto accumulate(ARGS &&...args)
Definition: gpu_enabled.h:42

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t ColSlotContext::getColCount ( ) const

Definition at line 133 of file ColSlotContext.cpp.

References col_to_slot_map_.

Referenced by QueryMemoryDescriptor::getColCount().

133  {
134  return col_to_slot_map_.size();
135 }
std::vector< std::vector< size_t > > col_to_slot_map_

+ Here is the caller graph for this function:

size_t ColSlotContext::getColOnlyOffInBytes ( const size_t  slot_idx) const

Definition at line 218 of file ColSlotContext.cpp.

References align_to_int64(), CHECK_LT, getAlignedPaddedSizeForRange(), and slot_sizes_.

Referenced by QueryMemoryDescriptor::getColOnlyOffInBytes().

218  {
219  CHECK_LT(slot_idx, slot_sizes_.size());
220  auto offset_bytes = getAlignedPaddedSizeForRange(slot_idx);
221  if (slot_sizes_[slot_idx].padded_size == sizeof(int64_t)) {
222  offset_bytes = align_to_int64(offset_bytes);
223  }
224  return offset_bytes;
225 }
std::vector< SlotSize > slot_sizes_
size_t getAlignedPaddedSizeForRange(const size_t end) const
#define CHECK_LT(x, y)
Definition: Logger.h:221
FORCE_INLINE HOST DEVICE T align_to_int64(T addr)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t ColSlotContext::getCompactByteWidth ( ) const

Definition at line 194 of file ColSlotContext.cpp.

References CHECK_EQ, CHECK_GT, and slot_sizes_.

Referenced by QueryMemoryDescriptor::getCompactByteWidth().

194  {
195  if (slot_sizes_.empty()) {
196  return 8;
197  }
198  size_t compact_width{0};
199  for (const auto& slot_size : slot_sizes_) {
200  if (slot_size.padded_size != 0) {
201  compact_width = slot_size.padded_size;
202  break;
203  }
204  }
205  if (!compact_width) {
206  return 0;
207  }
208  CHECK_GT(compact_width, size_t(0));
209  for (const auto& slot_size : slot_sizes_) {
210  if (slot_size.padded_size == 0) {
211  continue;
212  }
213  CHECK_EQ(static_cast<size_t>(slot_size.padded_size), compact_width);
214  }
215  return compact_width;
216 }
#define CHECK_EQ(x, y)
Definition: Logger.h:219
std::vector< SlotSize > slot_sizes_
#define CHECK_GT(x, y)
Definition: Logger.h:223

+ Here is the caller graph for this function:

int8_t ColSlotContext::getMinPaddedByteSize ( const int8_t  actual_min_byte_width) const

Definition at line 183 of file ColSlotContext.cpp.

References slot_sizes_.

Referenced by QueryMemoryDescriptor::updateActualMinByteWidth().

183  {
184  if (slot_sizes_.empty()) {
185  return actual_min_byte_width;
186  }
187  const auto min_padded_size = std::min_element(
188  slot_sizes_.cbegin(), slot_sizes_.cend(), [](const auto& lhs, const auto& rhs) {
189  return lhs.padded_size < rhs.padded_size;
190  });
191  return std::min(min_padded_size->padded_size, actual_min_byte_width);
192 }
std::vector< SlotSize > slot_sizes_

+ Here is the caller graph for this function:

size_t ColSlotContext::getSlotCount ( ) const

Definition at line 136 of file ColSlotContext.cpp.

References slot_sizes_.

Referenced by QueryMemoryDescriptor::getBufferColSlotCount(), QueryMemoryDescriptor::getSlotCount(), QueryMemoryDescriptor::varlenOutputBufferElemSize(), and QueryMemoryDescriptor::varlenOutputRowSizeToSlot().

136  {
137  return slot_sizes_.size();
138 }
std::vector< SlotSize > slot_sizes_

+ Here is the caller graph for this function:

const SlotSize& ColSlotContext::getSlotInfo ( const size_t  slot_idx) const
inline

Definition at line 67 of file ColSlotContext.h.

References CHECK_LT, and slot_sizes_.

Referenced by QueryMemoryDescriptor::getLogicalSlotWidthBytes(), and QueryMemoryDescriptor::getPaddedSlotWidthBytes().

67  {
68  CHECK_LT(slot_idx, slot_sizes_.size());
69  return slot_sizes_[slot_idx];
70  }
std::vector< SlotSize > slot_sizes_
#define CHECK_LT(x, y)
Definition: Logger.h:221

+ Here is the caller graph for this function:

const std::vector<size_t>& ColSlotContext::getSlotsForCol ( const size_t  col_idx) const
inline

Definition at line 77 of file ColSlotContext.h.

References CHECK_LT, and col_to_slot_map_.

Referenced by QueryMemoryDescriptor::getSlotIndexForSingleSlotCol().

77  {
78  CHECK_LT(col_idx, col_to_slot_map_.size());
79  return col_to_slot_map_[col_idx];
80  }
std::vector< std::vector< size_t > > col_to_slot_map_
#define CHECK_LT(x, y)
Definition: Logger.h:221

+ Here is the caller graph for this function:

size_t ColSlotContext::getTotalBytesOfColumnarBuffers ( const size_t  entry_count) const

Definition at line 170 of file ColSlotContext.cpp.

References gpu_enabled::accumulate(), align_to_int64(), CHECK_GE, and slot_sizes_.

Referenced by QueryMemoryDescriptor::getTotalBytesOfColumnarBuffers().

170  {
171  const auto total_bytes = std::accumulate(
172  slot_sizes_.cbegin(),
173  slot_sizes_.cend(),
174  size_t(0),
175  [entry_count](size_t sum, const auto& slot_size) {
176  CHECK_GE(slot_size.padded_size, 0);
177  return sum +
178  align_to_int64(static_cast<size_t>(slot_size.padded_size) * entry_count);
179  });
180  return align_to_int64(total_bytes);
181 }
#define CHECK_GE(x, y)
Definition: Logger.h:224
std::vector< SlotSize > slot_sizes_
DEVICE auto accumulate(ARGS &&...args)
Definition: gpu_enabled.h:42
FORCE_INLINE HOST DEVICE T align_to_int64(T addr)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ColSlotContext::hasVarlenOutput ( ) const
inline

Definition at line 116 of file ColSlotContext.h.

References varlen_output_slot_map_.

Referenced by QueryMemoryDescriptor::hasVarlenOutput().

116 { return !varlen_output_slot_map_.empty(); }
std::unordered_map< SlotIndex, ArraySize > varlen_output_slot_map_

+ Here is the caller graph for this function:

bool ColSlotContext::operator!= ( const ColSlotContext that) const
inline

Definition at line 110 of file ColSlotContext.h.

110 { return !(*this == that); }
bool ColSlotContext::operator== ( const ColSlotContext that) const
inline

Definition at line 102 of file ColSlotContext.h.

References col_to_slot_map_, and slot_sizes_.

102  {
103  return std::equal(
104  slot_sizes_.cbegin(), slot_sizes_.cend(), that.slot_sizes_.cbegin()) &&
105  std::equal(col_to_slot_map_.cbegin(),
106  col_to_slot_map_.cend(),
107  that.col_to_slot_map_.cbegin());
108  }
std::vector< std::vector< size_t > > col_to_slot_map_
std::vector< SlotSize > slot_sizes_
void ColSlotContext::setAllSlotsPaddedSize ( const int8_t  padded_size)

Definition at line 106 of file ColSlotContext.cpp.

References slot_sizes_.

106  {
107  for (auto& slot_size : slot_sizes_) {
108  slot_size.padded_size = padded_size;
109  }
110 }
std::vector< SlotSize > slot_sizes_
void ColSlotContext::setAllSlotsPaddedSizeToLogicalSize ( )

Definition at line 120 of file ColSlotContext.cpp.

References slot_sizes_.

Referenced by QueryMemoryDescriptor::QueryMemoryDescriptor(), and QueryMemoryDescriptor::setOutputColumnar().

120  {
121  for (auto& slot_size : slot_sizes_) {
122  slot_size.padded_size = slot_size.logical_size;
123  }
124 }
std::vector< SlotSize > slot_sizes_

+ Here is the caller graph for this function:

void ColSlotContext::setAllSlotsSize ( const int8_t  slot_width_size)

Definition at line 101 of file ColSlotContext.cpp.

References gpu_enabled::fill(), and slot_sizes_.

Referenced by QueryMemoryDescriptor::useConsistentSlotWidthSize().

101  {
102  const SlotSize ss{slot_width_size, slot_width_size};
103  std::fill(slot_sizes_.begin(), slot_sizes_.end(), ss);
104 }
std::vector< SlotSize > slot_sizes_
DEVICE void fill(ARGS &&...args)
Definition: gpu_enabled.h:60

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ColSlotContext::setAllUnsetSlotsPaddedSize ( const int8_t  padded_size)

Definition at line 112 of file ColSlotContext.cpp.

References slot_sizes_.

Referenced by QueryMemoryDescriptor::QueryMemoryDescriptor().

112  {
113  for (auto& slot_size : slot_sizes_) {
114  if (slot_size.padded_size < 0) {
115  slot_size.padded_size = padded_size;
116  }
117  }
118 }
std::vector< SlotSize > slot_sizes_

+ Here is the caller graph for this function:

void ColSlotContext::setPaddedSlotWidthBytes ( const size_t  slot_idx,
const int8_t  bytes 
)
inline

Definition at line 72 of file ColSlotContext.h.

References CHECK_LT, and slot_sizes_.

Referenced by QueryMemoryDescriptor::setPaddedSlotWidthBytes().

72  {
73  CHECK_LT(slot_idx, slot_sizes_.size());
74  slot_sizes_[slot_idx].padded_size = bytes;
75  }
std::vector< SlotSize > slot_sizes_
#define CHECK_LT(x, y)
Definition: Logger.h:221

+ Here is the caller graph for this function:

bool ColSlotContext::slotIsVarlen ( const size_t  slot_idx) const
inline

Definition at line 118 of file ColSlotContext.h.

References varlen_output_slot_map_.

Referenced by QueryMemoryDescriptor::slotIsVarlenOutput().

118  {
119  return varlen_output_slot_map_.count(slot_idx) > 0;
120  }
std::unordered_map< SlotIndex, ArraySize > varlen_output_slot_map_

+ Here is the caller graph for this function:

std::string ColSlotContext::toString ( ) const
inline

Definition at line 122 of file ColSlotContext.h.

References i, slot_sizes_, and to_string().

Referenced by QueryMemoryDescriptor::reductionKey().

122  {
123  std::string str{"Col Slot Context State\n"};
124  if (slot_sizes_.empty()) {
125  str += "\tEmpty";
126  return str;
127  }
128  str += "\tN | P , L\n";
129  for (size_t i = 0; i < slot_sizes_.size(); i++) {
130  const auto& slot_size = slot_sizes_[i];
131  str += "\t" + std::to_string(i) + " | " + std::to_string(slot_size.padded_size) +
132  " , " + std::to_string(slot_size.logical_size) + "\n";
133  }
134  return str;
135  }
std::vector< SlotSize > slot_sizes_
std::string to_string(char const *&&v)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ColSlotContext::validate ( ) const

Definition at line 126 of file ColSlotContext.cpp.

References CHECK_GE, CHECK_LE, and slot_sizes_.

Referenced by QueryMemoryDescriptor::QueryMemoryDescriptor().

126  {
127  for (const auto& slot_size : slot_sizes_) {
128  CHECK_GE(slot_size.logical_size, 0);
129  CHECK_LE(slot_size.logical_size, slot_size.padded_size);
130  }
131 }
#define CHECK_GE(x, y)
Definition: Logger.h:224
std::vector< SlotSize > slot_sizes_
#define CHECK_LE(x, y)
Definition: Logger.h:222

+ Here is the caller graph for this function:

int64_t ColSlotContext::varlenOutputElementSize ( const size_t  slot_idx) const

Definition at line 283 of file ColSlotContext.cpp.

References to_string(), and varlen_output_slot_map_.

Referenced by QueryMemoryDescriptor::varlenOutputBufferElemSize(), and QueryMemoryDescriptor::varlenOutputRowSizeToSlot().

283  {
284  const auto varlen_map_it = varlen_output_slot_map_.find(slot_idx);
285  if (varlen_map_it == varlen_output_slot_map_.end()) {
286  throw std::runtime_error("Failed to find varlen map entry for slot " +
287  std::to_string(slot_idx));
288  }
289  return varlen_map_it->second;
290 }
std::unordered_map< SlotIndex, ArraySize > varlen_output_slot_map_
std::string to_string(char const *&&v)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<std::vector<size_t> > ColSlotContext::col_to_slot_map_
private
std::unordered_map<SlotIndex, ArraySize> ColSlotContext::varlen_output_slot_map_
private

The documentation for this class was generated from the following files: