OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ArrayOps.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
23 #include <cstdint>
24 #include "../Shared/funcannotations.h"
25 #include "../Utils/ChunkIter.h"
26 #include "TypePunning.h"
27 
28 #ifdef EXECUTE_INCLUDE
29 
30 extern "C" DEVICE RUNTIME_EXPORT int32_t array_size(int8_t* chunk_iter_,
31  const uint64_t row_pos,
32  const uint32_t elem_log_sz) {
33  if (!chunk_iter_) {
34  return 0;
35  }
36  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_);
37  ArrayDatum ad;
38  bool is_end;
39  ChunkIter_get_nth(chunk_iter, row_pos, &ad, &is_end);
40  return ad.is_null ? 0 : ad.length >> elem_log_sz;
41 }
42 
43 extern "C" DEVICE RUNTIME_EXPORT int32_t array_size_nullable(int8_t* chunk_iter_,
44  const uint64_t row_pos,
45  const uint32_t elem_log_sz,
46  const int32_t null_val) {
47  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_);
48  ArrayDatum ad;
49  bool is_end;
50  ChunkIter_get_nth(chunk_iter, row_pos, &ad, &is_end);
51  return ad.is_null ? null_val : ad.length >> elem_log_sz;
52 }
53 
54 extern "C" DEVICE RUNTIME_EXPORT int32_t array_size_1_nullable(int8_t* chunk_iter_,
55  const uint64_t row_pos,
56  const int32_t null_val) {
57  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_);
58  ArrayDatum ad;
59  bool is_end;
60  ChunkIter_get_nth(chunk_iter, row_pos, &ad, &is_end);
61  return ad.is_null ? null_val : 1;
62 }
63 
64 extern "C" DEVICE RUNTIME_EXPORT bool array_is_null(int8_t* chunk_iter_,
65  const uint64_t row_pos) {
66  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_);
67  ArrayDatum ad;
68  bool is_end;
69  ChunkIter_get_nth(chunk_iter, row_pos, &ad, &is_end);
70  return ad.is_null;
71 }
72 
73 extern "C" DEVICE RUNTIME_EXPORT bool point_coord_array_is_null(int8_t* chunk_iter_,
74  const uint64_t row_pos) {
75  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_);
76  ArrayDatum ad;
77  bool is_end;
78  ChunkIter_get_nth_point_coords(chunk_iter, row_pos, &ad, &is_end);
79  return ad.is_null;
80 }
81 
82 extern "C" DEVICE RUNTIME_EXPORT int32_t
83 point_coord_array_size(int8_t* chunk_iter_,
84  const uint64_t row_pos,
85  const uint32_t elem_log_sz) {
86  if (!chunk_iter_) {
87  return 0;
88  }
89  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_);
90  ArrayDatum ad;
91  bool is_end;
92  ChunkIter_get_nth_point_coords(chunk_iter, row_pos, &ad, &is_end);
93  return ad.is_null ? 0 : ad.length >> elem_log_sz;
94 }
95 
96 extern "C" DEVICE RUNTIME_EXPORT int32_t
97 point_coord_array_size_nullable(int8_t* chunk_iter_,
98  const uint64_t row_pos,
99  const uint32_t elem_log_sz,
100  const int32_t null_val) {
101  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_);
102  ArrayDatum ad;
103  bool is_end;
104  ChunkIter_get_nth_point_coords(chunk_iter, row_pos, &ad, &is_end);
105  return ad.is_null ? null_val : ad.length >> elem_log_sz;
106 }
107 
108 #define ARRAY_AT(type) \
109  extern "C" DEVICE RUNTIME_EXPORT type array_at_##type( \
110  int8_t* chunk_iter_, const uint64_t row_pos, const uint32_t elem_idx) { \
111  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_); \
112  ArrayDatum ad; \
113  bool is_end; \
114  ChunkIter_get_nth(chunk_iter, row_pos, &ad, &is_end); \
115  return reinterpret_cast<type*>(ad.pointer)[elem_idx]; \
116  }
117 
118 ARRAY_AT(int8_t)
119 ARRAY_AT(int16_t)
120 ARRAY_AT(int32_t)
121 ARRAY_AT(int64_t)
122 ARRAY_AT(float)
123 ARRAY_AT(double)
124 
125 #undef ARRAY_AT
126 
127 #define VARLEN_ARRAY_AT(type) \
128  extern "C" DEVICE RUNTIME_EXPORT type varlen_array_at_##type( \
129  int8_t* chunk_iter_, const uint64_t row_pos, const uint32_t elem_idx) { \
130  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_); \
131  ArrayDatum ad; \
132  bool is_end; \
133  ChunkIter_get_nth_varlen(chunk_iter, row_pos, &ad, &is_end); \
134  return reinterpret_cast<type*>(ad.pointer)[elem_idx]; \
135  }
136 
137 VARLEN_ARRAY_AT(int8_t)
138 VARLEN_ARRAY_AT(int16_t)
139 VARLEN_ARRAY_AT(int32_t)
140 VARLEN_ARRAY_AT(int64_t)
141 VARLEN_ARRAY_AT(float)
142 VARLEN_ARRAY_AT(double)
143 
144 #undef VARLEN_ARRAY_AT
145 
146 #define VARLEN_NOTNULL_ARRAY_AT(type) \
147  extern "C" DEVICE RUNTIME_EXPORT type varlen_notnull_array_at_##type( \
148  int8_t* chunk_iter_, const uint64_t row_pos, const uint32_t elem_idx) { \
149  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_); \
150  ArrayDatum ad; \
151  bool is_end; \
152  ChunkIter_get_nth_varlen_notnull(chunk_iter, row_pos, &ad, &is_end); \
153  return reinterpret_cast<type*>(ad.pointer)[elem_idx]; \
154  }
155 
156 VARLEN_NOTNULL_ARRAY_AT(int8_t)
157 VARLEN_NOTNULL_ARRAY_AT(int16_t)
158 VARLEN_NOTNULL_ARRAY_AT(int32_t)
159 VARLEN_NOTNULL_ARRAY_AT(int64_t)
160 VARLEN_NOTNULL_ARRAY_AT(float)
161 VARLEN_NOTNULL_ARRAY_AT(double)
162 
163 #undef VARLEN_NOTNULL_ARRAY_AT
164 
165 #define ARRAY_ANY(type, needle_type, oper_name, oper) \
166  extern "C" DEVICE RUNTIME_EXPORT bool array_any_##oper_name##_##type##_##needle_type( \
167  int8_t* chunk_iter_, \
168  const uint64_t row_pos, \
169  const needle_type needle, \
170  const type null_val) { \
171  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_); \
172  ArrayDatum ad; \
173  bool is_end; \
174  ChunkIter_get_nth(chunk_iter, row_pos, &ad, &is_end); \
175  const size_t elem_count = ad.length / sizeof(type); \
176  for (size_t i = 0; i < elem_count; ++i) { \
177  const needle_type val = reinterpret_cast<type*>(ad.pointer)[i]; \
178  if (val != null_val && val oper needle) { \
179  return true; \
180  } \
181  } \
182  return false; \
183  }
184 
185 #define ARRAY_ALL(type, needle_type, oper_name, oper) \
186  extern "C" DEVICE RUNTIME_EXPORT bool array_all_##oper_name##_##type##_##needle_type( \
187  int8_t* chunk_iter_, \
188  const uint64_t row_pos, \
189  const needle_type needle, \
190  const type null_val) { \
191  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_); \
192  ArrayDatum ad; \
193  bool is_end; \
194  ChunkIter_get_nth(chunk_iter, row_pos, &ad, &is_end); \
195  const size_t elem_count = ad.length / sizeof(type); \
196  for (size_t i = 0; i < elem_count; ++i) { \
197  const needle_type val = reinterpret_cast<type*>(ad.pointer)[i]; \
198  if (!(val != null_val && val oper needle)) { \
199  return false; \
200  } \
201  } \
202  return true; \
203  }
204 
205 #define ARRAY_ALL_ANY_ALL_TYPES(oper_name, oper, needle_type) \
206  ARRAY_ANY(int8_t, needle_type, oper_name, oper) \
207  ARRAY_ALL(int8_t, needle_type, oper_name, oper) \
208  ARRAY_ANY(int16_t, needle_type, oper_name, oper) \
209  ARRAY_ALL(int16_t, needle_type, oper_name, oper) \
210  ARRAY_ANY(int32_t, needle_type, oper_name, oper) \
211  ARRAY_ALL(int32_t, needle_type, oper_name, oper) \
212  ARRAY_ANY(int64_t, needle_type, oper_name, oper) \
213  ARRAY_ALL(int64_t, needle_type, oper_name, oper) \
214  ARRAY_ANY(float, needle_type, oper_name, oper) \
215  ARRAY_ALL(float, needle_type, oper_name, oper) \
216  ARRAY_ANY(double, needle_type, oper_name, oper) \
217  ARRAY_ALL(double, needle_type, oper_name, oper)
218 
219 ARRAY_ALL_ANY_ALL_TYPES(eq, ==, int8_t)
220 ARRAY_ALL_ANY_ALL_TYPES(ne, !=, int8_t)
221 ARRAY_ALL_ANY_ALL_TYPES(lt, <, int8_t)
222 ARRAY_ALL_ANY_ALL_TYPES(le, <=, int8_t)
223 ARRAY_ALL_ANY_ALL_TYPES(gt, >, int8_t)
224 ARRAY_ALL_ANY_ALL_TYPES(ge, >=, int8_t)
225 
226 ARRAY_ALL_ANY_ALL_TYPES(eq, ==, int16_t)
227 ARRAY_ALL_ANY_ALL_TYPES(ne, !=, int16_t)
228 ARRAY_ALL_ANY_ALL_TYPES(lt, <, int16_t)
229 ARRAY_ALL_ANY_ALL_TYPES(le, <=, int16_t)
230 ARRAY_ALL_ANY_ALL_TYPES(gt, >, int16_t)
231 ARRAY_ALL_ANY_ALL_TYPES(ge, >=, int16_t)
232 
233 ARRAY_ALL_ANY_ALL_TYPES(eq, ==, int32_t)
234 ARRAY_ALL_ANY_ALL_TYPES(ne, !=, int32_t)
235 ARRAY_ALL_ANY_ALL_TYPES(lt, <, int32_t)
236 ARRAY_ALL_ANY_ALL_TYPES(le, <=, int32_t)
237 ARRAY_ALL_ANY_ALL_TYPES(gt, >, int32_t)
238 ARRAY_ALL_ANY_ALL_TYPES(ge, >=, int32_t)
239 
240 ARRAY_ALL_ANY_ALL_TYPES(eq, ==, int64_t)
241 ARRAY_ALL_ANY_ALL_TYPES(ne, !=, int64_t)
242 ARRAY_ALL_ANY_ALL_TYPES(lt, <, int64_t)
243 ARRAY_ALL_ANY_ALL_TYPES(le, <=, int64_t)
244 ARRAY_ALL_ANY_ALL_TYPES(gt, >, int64_t)
245 ARRAY_ALL_ANY_ALL_TYPES(ge, >=, int64_t)
246 
247 ARRAY_ALL_ANY_ALL_TYPES(eq, ==, float)
248 ARRAY_ALL_ANY_ALL_TYPES(ne, !=, float)
249 ARRAY_ALL_ANY_ALL_TYPES(lt, <, float)
250 ARRAY_ALL_ANY_ALL_TYPES(le, <=, float)
251 ARRAY_ALL_ANY_ALL_TYPES(gt, >, float)
252 ARRAY_ALL_ANY_ALL_TYPES(ge, >=, float)
253 
254 ARRAY_ALL_ANY_ALL_TYPES(eq, ==, double)
255 ARRAY_ALL_ANY_ALL_TYPES(ne, !=, double)
256 ARRAY_ALL_ANY_ALL_TYPES(lt, <, double)
257 ARRAY_ALL_ANY_ALL_TYPES(le, <=, double)
258 ARRAY_ALL_ANY_ALL_TYPES(gt, >, double)
259 ARRAY_ALL_ANY_ALL_TYPES(ge, >=, double)
260 
261 #undef ARRAY_ALL_ANY_ALL_TYPES
262 #undef ARRAY_ALL
263 #undef ARRAY_ANY
264 
265 #define ARRAY_AT_CHECKED(type) \
266  extern "C" DEVICE RUNTIME_EXPORT type array_at_##type##_checked( \
267  int8_t* chunk_iter_, \
268  const uint64_t row_pos, \
269  const int64_t elem_idx, \
270  const type null_val) { \
271  if (elem_idx <= 0) { \
272  return null_val; \
273  } \
274  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_); \
275  ArrayDatum ad; \
276  bool is_end; \
277  ChunkIter_get_nth(chunk_iter, row_pos, &ad, &is_end); \
278  if (ad.is_null || static_cast<size_t>(elem_idx) > ad.length / sizeof(type)) { \
279  return null_val; \
280  } \
281  return reinterpret_cast<type*>(ad.pointer)[elem_idx - 1]; \
282  }
283 
284 ARRAY_AT_CHECKED(int8_t)
285 ARRAY_AT_CHECKED(int16_t)
286 ARRAY_AT_CHECKED(int32_t)
287 ARRAY_AT_CHECKED(int64_t)
288 ARRAY_AT_CHECKED(float)
289 ARRAY_AT_CHECKED(double)
290 
291 #undef ARRAY_AT_CHECKED
292 
293 extern "C" DEVICE RUNTIME_EXPORT int8_t* allocate_varlen_buffer(int64_t element_count,
294  int64_t element_size) {
295 #ifndef __CUDACC__
296  int8_t* varlen_buffer =
297  reinterpret_cast<int8_t*>(checked_malloc((element_count + 1) * element_size));
298  return varlen_buffer;
299 #else
300  return nullptr;
301 #endif
302 }
303 
304 extern "C" DEVICE RUNTIME_EXPORT ALWAYS_INLINE int32_t
305 fast_fixlen_array_size(int8_t* chunk_iter_, const uint32_t elem_log_sz) {
306  ChunkIter* it = reinterpret_cast<ChunkIter*>(chunk_iter_);
307  return it->skip_size >> elem_log_sz;
308 }
309 
310 extern "C" DEVICE RUNTIME_EXPORT ALWAYS_INLINE int8_t* fast_fixlen_array_buff(
311  int8_t* chunk_iter_,
312  const uint64_t row_pos) {
313  if (!chunk_iter_) {
314  return nullptr;
315  }
316  ChunkIter* it = reinterpret_cast<ChunkIter*>(chunk_iter_);
317  auto n = static_cast<int>(row_pos);
318  int8_t* current_pos = it->start_pos + n * it->skip_size;
319  return current_pos;
320 }
321 
322 extern "C" DEVICE RUNTIME_EXPORT ALWAYS_INLINE int64_t
323 determine_fixed_array_len(int8_t* chunk_iter, int64_t valid_len) {
324  return chunk_iter ? valid_len : 0;
325 }
326 
327 extern "C" DEVICE RUNTIME_EXPORT int8_t* array_buff(int8_t* chunk_iter_,
328  const uint64_t row_pos) {
329  if (!chunk_iter_) {
330  return nullptr;
331  }
332  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_);
333  ArrayDatum ad;
334  bool is_end;
335  ChunkIter_get_nth(chunk_iter, row_pos, &ad, &is_end);
336  return ad.pointer;
337 }
338 
339 #ifndef __CUDACC__
340 
341 extern "C" RUNTIME_EXPORT ALWAYS_INLINE int64_t elem_bitcast_int8_t(const int8_t val) {
342  return val;
343 }
344 
345 extern "C" RUNTIME_EXPORT ALWAYS_INLINE int64_t elem_bitcast_int16_t(const int16_t val) {
346  return val;
347 }
348 
349 extern "C" RUNTIME_EXPORT ALWAYS_INLINE int64_t elem_bitcast_int32_t(const int32_t val) {
350  return val;
351 }
352 
353 extern "C" RUNTIME_EXPORT ALWAYS_INLINE int64_t elem_bitcast_int64_t(const int64_t val) {
354  return val;
355 }
356 
357 extern "C" RUNTIME_EXPORT ALWAYS_INLINE int64_t elem_bitcast_float(const float val) {
358  const double dval{val};
359  return *reinterpret_cast<const int64_t*>(may_alias_ptr(&dval));
360 }
361 
362 extern "C" RUNTIME_EXPORT ALWAYS_INLINE int64_t elem_bitcast_double(const double val) {
363  return *reinterpret_cast<const int64_t*>(may_alias_ptr(&val));
364 }
365 
366 #define COUNT_DISTINCT_ARRAY(type) \
367  extern "C" RUNTIME_EXPORT void agg_count_distinct_array_##type( \
368  int64_t* agg, int8_t* chunk_iter_, const uint64_t row_pos, const type null_val) { \
369  ChunkIter* chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_); \
370  ArrayDatum ad; \
371  bool is_end; \
372  ChunkIter_get_nth(chunk_iter, row_pos, &ad, &is_end); \
373  const size_t elem_count{ad.length / sizeof(type)}; \
374  for (size_t i = 0; i < elem_count; ++i) { \
375  const auto val = reinterpret_cast<type*>(ad.pointer)[i]; \
376  if (val != null_val) { \
377  reinterpret_cast<CountDistinctSet*>(*agg)->insert(elem_bitcast_##type(val)); \
378  } \
379  } \
380  }
381 
382 COUNT_DISTINCT_ARRAY(int8_t)
383 COUNT_DISTINCT_ARRAY(int16_t)
384 COUNT_DISTINCT_ARRAY(int32_t)
385 COUNT_DISTINCT_ARRAY(int64_t)
386 COUNT_DISTINCT_ARRAY(float)
387 COUNT_DISTINCT_ARRAY(double)
388 
389 #undef COUNT_DISTINCT_ARRAY
390 
391 #include <functional>
392 #include <string_view>
393 
394 extern "C" RUNTIME_EXPORT StringView string_decompress(const int32_t string_id,
395  const int64_t string_dict_handle);
396 
397 template <typename T>
398 bool array_any(int8_t* const chunk_iter_i8,
399  uint64_t const row_pos,
400  std::string_view const needle_str,
401  int64_t const string_dict_handle,
402  T const null_val,
403  std::function<bool(std::string_view, std::string_view)> const cmp) {
404  ChunkIter* const chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_i8);
405  ArrayDatum ad;
406  bool is_end;
407  ChunkIter_get_nth(chunk_iter, row_pos, &ad, &is_end);
408  size_t const elem_count = ad.length / sizeof(T);
409  for (size_t i = 0; i < elem_count; ++i) {
410  T const val = reinterpret_cast<T*>(ad.pointer)[i];
411  if (val != null_val) {
412  StringView const sv = string_decompress(val, string_dict_handle);
413  if (cmp(sv.stringView(), needle_str)) {
414  return true;
415  }
416  }
417  }
418  return false;
419 }
420 
421 template <typename T>
422 bool array_all(int8_t* const chunk_iter_i8,
423  uint64_t const row_pos,
424  std::string_view const needle_str,
425  int64_t const string_dict_handle,
426  T const null_val,
427  std::function<bool(std::string_view, std::string_view)> const cmp) {
428  ChunkIter* const chunk_iter = reinterpret_cast<ChunkIter*>(chunk_iter_i8);
429  ArrayDatum ad;
430  bool is_end;
431  ChunkIter_get_nth(chunk_iter, row_pos, &ad, &is_end);
432  size_t const elem_count = ad.length / sizeof(T);
433  for (size_t i = 0; i < elem_count; ++i) {
434  T const val = reinterpret_cast<T*>(ad.pointer)[i];
435  if (val == null_val) {
436  return false;
437  }
438  StringView const sv = string_decompress(val, string_dict_handle);
439  if (!cmp(sv.stringView(), needle_str)) {
440  return false;
441  }
442  }
443  return true;
444 }
445 
446 #define ARRAY_STR_ANY(type, oper_name, oper) \
447  extern "C" RUNTIME_EXPORT bool array_any_##oper_name##_str_##type( \
448  int8_t* const chunk_iter_i8, \
449  uint64_t const row_pos, \
450  char const* const needle_ptr, \
451  uint32_t const needle_len, \
452  int64_t const string_dict_handle, \
453  type const null_val) { \
454  return array_any(chunk_iter_i8, \
455  row_pos, \
456  std::string_view{needle_ptr, needle_len}, \
457  string_dict_handle, \
458  null_val, \
459  std::oper<std::string_view>{}); \
460  }
461 
462 #define ARRAY_STR_ALL(type, oper_name, oper) \
463  extern "C" RUNTIME_EXPORT bool array_all_##oper_name##_str_##type( \
464  int8_t* const chunk_iter_i8, \
465  uint64_t const row_pos, \
466  char const* const needle_ptr, \
467  uint32_t const needle_len, \
468  int64_t const string_dict_handle, \
469  type const null_val) { \
470  return array_all(chunk_iter_i8, \
471  row_pos, \
472  std::string_view{needle_ptr, needle_len}, \
473  string_dict_handle, \
474  null_val, \
475  std::oper<std::string_view>{}); \
476  }
477 
478 #define ARRAY_STR_ALL_ANY_ALL_TYPES(oper_name, oper) \
479  ARRAY_STR_ANY(int8_t, oper_name, oper) \
480  ARRAY_STR_ALL(int8_t, oper_name, oper) \
481  ARRAY_STR_ANY(int16_t, oper_name, oper) \
482  ARRAY_STR_ALL(int16_t, oper_name, oper) \
483  ARRAY_STR_ANY(int32_t, oper_name, oper) \
484  ARRAY_STR_ALL(int32_t, oper_name, oper) \
485  ARRAY_STR_ANY(int64_t, oper_name, oper) \
486  ARRAY_STR_ALL(int64_t, oper_name, oper)
487 
488 ARRAY_STR_ALL_ANY_ALL_TYPES(eq, equal_to)
489 ARRAY_STR_ALL_ANY_ALL_TYPES(ne, not_equal_to)
490 ARRAY_STR_ALL_ANY_ALL_TYPES(lt, less)
491 ARRAY_STR_ALL_ANY_ALL_TYPES(le, less_equal)
492 ARRAY_STR_ALL_ANY_ALL_TYPES(gt, greater)
493 ARRAY_STR_ALL_ANY_ALL_TYPES(ge, greater_equal)
494 
495 #undef ARRAY_ALL_ANY_ALL_TYPES
496 #undef ARRAY_STR_ALL
497 #undef ARRAY_STR_ANY
498 
499 #endif
500 
501 #endif // EXECUTE_INCLUDE
int8_t * start_pos
Definition: ChunkIter.h:34
DEVICE void ChunkIter_get_nth_point_coords(ChunkIter *it, int n, ArrayDatum *result, bool *is_end)
Definition: ChunkIter.cpp:321
DEVICE void ChunkIter_get_nth(ChunkIter *it, int n, bool uncompress, VarlenDatum *result, bool *is_end)
Definition: ChunkIter.cpp:182
#define DEVICE
std::conditional_t< is_cuda_compiler(), DeviceArrayDatum, HostArrayDatum > ArrayDatum
Definition: sqltypes.h:229
EXTENSION_NOINLINE int8_t * allocate_varlen_buffer(int64_t element_count, int64_t element_size)
void * checked_malloc(const size_t size)
Definition: checked_alloc.h:45
std::string_view stringView() const
Definition: Datum.h:46
#define RUNTIME_EXPORT
int skip_size
Definition: ChunkIter.h:37
constexpr double n
Definition: Utm.h:38
#define ALWAYS_INLINE
RUNTIME_EXPORT StringView string_decompress(const int32_t string_id, const int64_t string_dict_handle)
Definition: StringOpsIR.cpp:38