OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ArrayTestTableFunctions.cpp File Reference
+ Include dependency graph for ArrayTestTableFunctions.cpp:

Go to the source code of this file.

Functions

template<typename T >
NEVER_INLINE HOST int32_t sum_along_row__cpu_template (const Column< Array< T >> &input, Column< T > &output)
 
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template (const Column< Array< float >> &input, Column< float > &output)
 
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template (const Column< Array< double >> &input, Column< double > &output)
 
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template (const Column< Array< int8_t >> &input, Column< int8_t > &output)
 
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template (const Column< Array< int16_t >> &input, Column< int16_t > &output)
 
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template (const Column< Array< int32_t >> &input, Column< int32_t > &output)
 
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template (const Column< Array< int64_t >> &input, Column< int64_t > &output)
 
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template (const Column< Array< bool >> &input, Column< bool > &output)
 
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template (const Column< Array< TextEncodingDict >> &input, Column< TextEncodingDict > &output)
 
template<typename T >
NEVER_INLINE HOST int32_t array_copier__cpu_template (TableFunctionManager &mgr, const Column< Array< T >> &input, Column< Array< T >> &output)
 
template NEVER_INLINE HOST int32_t array_copier__cpu_template (TableFunctionManager &mgr, const Column< Array< float >> &input, Column< Array< float >> &output)
 
template NEVER_INLINE HOST int32_t array_copier__cpu_template (TableFunctionManager &mgr, const Column< Array< double >> &input, Column< Array< double >> &output)
 
template NEVER_INLINE HOST int32_t array_copier__cpu_template (TableFunctionManager &mgr, const Column< Array< int8_t >> &input, Column< Array< int8_t >> &output)
 
template NEVER_INLINE HOST int32_t array_copier__cpu_template (TableFunctionManager &mgr, const Column< Array< int16_t >> &input, Column< Array< int16_t >> &output)
 
template NEVER_INLINE HOST int32_t array_copier__cpu_template (TableFunctionManager &mgr, const Column< Array< int32_t >> &input, Column< Array< int32_t >> &output)
 
template NEVER_INLINE HOST int32_t array_copier__cpu_template (TableFunctionManager &mgr, const Column< Array< int64_t >> &input, Column< Array< int64_t >> &output)
 
template NEVER_INLINE HOST int32_t array_copier__cpu_template (TableFunctionManager &mgr, const Column< Array< bool >> &input, Column< Array< bool >> &output)
 
template NEVER_INLINE HOST int32_t array_copier__cpu_template (TableFunctionManager &mgr, const Column< Array< TextEncodingDict >> &input, Column< Array< TextEncodingDict >> &output)
 
template<typename T >
NEVER_INLINE HOST int32_t array_concat__cpu_template (TableFunctionManager &mgr, const ColumnList< Array< T >> &inputs, Column< Array< T >> &output)
 
template<typename T >
NEVER_INLINE HOST int32_t array_append__cpu_template (TableFunctionManager &mgr, const Column< Array< T >> &input1, const Array< T > &input2, Column< Array< T >> &output)
 
template NEVER_INLINE HOST int32_t array_concat__cpu_template (TableFunctionManager &mgr, const ColumnList< Array< float >> &inputs, Column< Array< float >> &output)
 
template NEVER_INLINE HOST int32_t array_concat__cpu_template (TableFunctionManager &mgr, const ColumnList< Array< double >> &inputs, Column< Array< double >> &output)
 
template NEVER_INLINE HOST int32_t array_concat__cpu_template (TableFunctionManager &mgr, const ColumnList< Array< int8_t >> &inputs, Column< Array< int8_t >> &output)
 
template NEVER_INLINE HOST int32_t array_concat__cpu_template (TableFunctionManager &mgr, const ColumnList< Array< int16_t >> &inputs, Column< Array< int16_t >> &output)
 
template NEVER_INLINE HOST int32_t array_concat__cpu_template (TableFunctionManager &mgr, const ColumnList< Array< int32_t >> &inputs, Column< Array< int32_t >> &output)
 
template NEVER_INLINE HOST int32_t array_concat__cpu_template (TableFunctionManager &mgr, const ColumnList< Array< int64_t >> &inputs, Column< Array< int64_t >> &output)
 
template NEVER_INLINE HOST int32_t array_concat__cpu_template (TableFunctionManager &mgr, const ColumnList< Array< bool >> &inputs, Column< Array< bool >> &output)
 
template NEVER_INLINE HOST int32_t array_concat__cpu_template (TableFunctionManager &mgr, const ColumnList< Array< TextEncodingDict >> &inputs, Column< Array< TextEncodingDict >> &output)
 
template NEVER_INLINE HOST int32_t array_append__cpu_template (TableFunctionManager &mgr, const Column< Array< float >> &input1, const Array< float > &input2, Column< Array< float >> &output)
 
template NEVER_INLINE HOST int32_t array_append__cpu_template (TableFunctionManager &mgr, const Column< Array< double >> &input1, const Array< double > &input2, Column< Array< double >> &output)
 
template NEVER_INLINE HOST int32_t array_append__cpu_template (TableFunctionManager &mgr, const Column< Array< int8_t >> &input1, const Array< int8_t > &input2, Column< Array< int8_t >> &output)
 
template NEVER_INLINE HOST int32_t array_append__cpu_template (TableFunctionManager &mgr, const Column< Array< int16_t >> &input1, const Array< int16_t > &input2, Column< Array< int16_t >> &output)
 
template NEVER_INLINE HOST int32_t array_append__cpu_template (TableFunctionManager &mgr, const Column< Array< int32_t >> &input1, const Array< int32_t > &input2, Column< Array< int32_t >> &output)
 
template NEVER_INLINE HOST int32_t array_append__cpu_template (TableFunctionManager &mgr, const Column< Array< int64_t >> &input1, const Array< int64_t > &input2, Column< Array< int64_t >> &output)
 
template NEVER_INLINE HOST int32_t array_append__cpu_template (TableFunctionManager &mgr, const Column< Array< bool >> &input1, const Array< bool > &input2, Column< Array< bool >> &output)
 
template<typename T >
NEVER_INLINE HOST int32_t array_asarray__cpu_template (TableFunctionManager &mgr, const Column< T > &input, Column< Array< T >> &output)
 
template NEVER_INLINE HOST int32_t array_asarray__cpu_template (TableFunctionManager &mgr, const Column< int64_t > &input, Column< Array< int64_t >> &output)
 
template NEVER_INLINE HOST int32_t array_asarray__cpu_template (TableFunctionManager &mgr, const Column< TextEncodingDict > &input, Column< Array< TextEncodingDict >> &output)
 
template<typename T >
NEVER_INLINE HOST int32_t array_split__cpu_template (TableFunctionManager &mgr, const Column< Array< T >> &input, Column< Array< T >> &first, Column< Array< T >> &second)
 
template NEVER_INLINE HOST int32_t array_split__cpu_template (TableFunctionManager &mgr, const Column< Array< float >> &input, Column< Array< float >> &first, Column< Array< float >> &second)
 
template NEVER_INLINE HOST int32_t array_split__cpu_template (TableFunctionManager &mgr, const Column< Array< double >> &input, Column< Array< double >> &first, Column< Array< double >> &second)
 
template NEVER_INLINE HOST int32_t array_split__cpu_template (TableFunctionManager &mgr, const Column< Array< int8_t >> &input, Column< Array< int8_t >> &first, Column< Array< int8_t >> &second)
 
template NEVER_INLINE HOST int32_t array_split__cpu_template (TableFunctionManager &mgr, const Column< Array< int16_t >> &input, Column< Array< int16_t >> &first, Column< Array< int16_t >> &second)
 
template NEVER_INLINE HOST int32_t array_split__cpu_template (TableFunctionManager &mgr, const Column< Array< int32_t >> &input, Column< Array< int32_t >> &first, Column< Array< int32_t >> &second)
 
template NEVER_INLINE HOST int32_t array_split__cpu_template (TableFunctionManager &mgr, const Column< Array< int64_t >> &input, Column< Array< int64_t >> &first, Column< Array< int64_t >> &second)
 
template NEVER_INLINE HOST int32_t array_split__cpu_template (TableFunctionManager &mgr, const Column< Array< bool >> &input, Column< Array< bool >> &first, Column< Array< bool >> &second)
 
template NEVER_INLINE HOST int32_t array_split__cpu_template (TableFunctionManager &mgr, const Column< Array< TextEncodingDict >> &input, Column< Array< TextEncodingDict >> &first, Column< Array< TextEncodingDict >> &second)
 

Function Documentation

template<typename T >
NEVER_INLINE HOST int32_t array_append__cpu_template ( TableFunctionManager mgr,
const Column< Array< T >> &  input1,
const Array< T > &  input2,
Column< Array< T >> &  output 
)

Definition at line 177 of file ArrayTestTableFunctions.cpp.

References TableFunctionManager::set_output_array_values_total_number(), TableFunctionManager::set_output_row_size(), and Array< T >::size().

180  {
181  int size = input1.size();
182  int output_values_size = input2.size() * size;
183  for (int i = 0; i < size; i++) {
184  output_values_size += input1[i].size();
185  }
187  /*output column index=*/0,
188  /*upper bound to the number of items in all output arrays=*/output_values_size);
189 
190  mgr.set_output_row_size(size);
191 
192  for (int i = 0; i < size; i++) {
193  output.concatItem(i, input1[i]);
194  output.concatItem(i, input2);
195  }
196  return size;
197 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
void set_output_array_values_total_number(int32_t index, int64_t output_array_values_total_number)
Definition: heavydbTypes.h:361
DEVICE int64_t size() const
DEVICE ALWAYS_INLINE size_t size() const
Definition: heavydbTypes.h:520

+ Here is the call graph for this function:

template NEVER_INLINE HOST int32_t array_append__cpu_template ( TableFunctionManager mgr,
const Column< Array< float >> &  input1,
const Array< float > &  input2,
Column< Array< float >> &  output 
)
template NEVER_INLINE HOST int32_t array_append__cpu_template ( TableFunctionManager mgr,
const Column< Array< double >> &  input1,
const Array< double > &  input2,
Column< Array< double >> &  output 
)
template NEVER_INLINE HOST int32_t array_append__cpu_template ( TableFunctionManager mgr,
const Column< Array< int8_t >> &  input1,
const Array< int8_t > &  input2,
Column< Array< int8_t >> &  output 
)
template NEVER_INLINE HOST int32_t array_append__cpu_template ( TableFunctionManager mgr,
const Column< Array< int16_t >> &  input1,
const Array< int16_t > &  input2,
Column< Array< int16_t >> &  output 
)
template NEVER_INLINE HOST int32_t array_append__cpu_template ( TableFunctionManager mgr,
const Column< Array< int32_t >> &  input1,
const Array< int32_t > &  input2,
Column< Array< int32_t >> &  output 
)
template NEVER_INLINE HOST int32_t array_append__cpu_template ( TableFunctionManager mgr,
const Column< Array< int64_t >> &  input1,
const Array< int64_t > &  input2,
Column< Array< int64_t >> &  output 
)
template NEVER_INLINE HOST int32_t array_append__cpu_template ( TableFunctionManager mgr,
const Column< Array< bool >> &  input1,
const Array< bool > &  input2,
Column< Array< bool >> &  output 
)
template<typename T >
NEVER_INLINE HOST int32_t array_asarray__cpu_template ( TableFunctionManager mgr,
const Column< T > &  input,
Column< Array< T >> &  output 
)

Definition at line 270 of file ArrayTestTableFunctions.cpp.

References TableFunctionManager::getNewDictDbId(), TableFunctionManager::getNewDictId(), TableFunctionManager::getOrAddTransient(), TableFunctionManager::getString(), Column< T >::isNull(), TableFunctionManager::set_output_array_values_total_number(), TableFunctionManager::set_output_row_size(), and Column< T >::size().

272  {
273  int size = input.size();
274  int output_values_size = 0;
275  for (int i = 0; i < size; i++) {
276  output_values_size += (input.isNull(i) ? 0 : 1);
277  }
279  /*output column index=*/0,
280  /*upper bound to the number of items in all output arrays=*/output_values_size);
281  mgr.set_output_row_size(size);
282 
283  if constexpr (std::is_same<T, TextEncodingDict>::value) {
284  for (int i = 0; i < size; i++) {
285  if (input.isNull(i)) {
286  output.setNull(i);
287  } else {
288  Array<T> arr = output.getItem(i, 1);
289  arr[0] = mgr.getOrAddTransient(
290  mgr.getNewDictDbId(),
291  mgr.getNewDictId(),
292  mgr.getString(input.getDictDbId(), input.getDictId(), input[i]));
293  }
294  }
295  } else {
296  for (int i = 0; i < size; i++) {
297  if (input.isNull(i)) {
298  output.setNull(i);
299  } else {
300  Array<T> arr = output.getItem(i, 1);
301  arr[0] = input[i];
302  }
303  }
304  }
305  return size;
306 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
std::string getString(int32_t db_id, int32_t dict_id, int32_t string_id)
Definition: heavydbTypes.h:422
void set_output_array_values_total_number(int32_t index, int64_t output_array_values_total_number)
Definition: heavydbTypes.h:361
int32_t getOrAddTransient(int32_t db_id, int32_t dict_id, std::string str)
Definition: heavydbTypes.h:426
DEVICE int64_t size() const
int32_t getNewDictDbId()
Definition: heavydbTypes.h:411
DEVICE bool isNull(int64_t index) const
DEVICE void setNull(int64_t index)

+ Here is the call graph for this function:

template NEVER_INLINE HOST int32_t array_asarray__cpu_template ( TableFunctionManager mgr,
const Column< int64_t > &  input,
Column< Array< int64_t >> &  output 
)
template NEVER_INLINE HOST int32_t array_asarray__cpu_template ( TableFunctionManager mgr,
const Column< TextEncodingDict > &  input,
Column< Array< TextEncodingDict >> &  output 
)
template<typename T >
NEVER_INLINE HOST int32_t array_concat__cpu_template ( TableFunctionManager mgr,
const ColumnList< Array< T >> &  inputs,
Column< Array< T >> &  output 
)

Definition at line 149 of file ArrayTestTableFunctions.cpp.

References TableFunctionManager::set_output_array_values_total_number(), and TableFunctionManager::set_output_row_size().

151  {
152  int size = inputs.size();
153 
154  int output_values_size = 0;
155  for (int j = 0; j < inputs.numCols(); j++) {
156  for (int i = 0; i < size; i++) {
157  output_values_size += inputs[j][i].size();
158  }
159  }
161  /*output column index=*/0,
162  /*upper bound to the number of items in all output arrays=*/output_values_size);
163 
164  mgr.set_output_row_size(size);
165 
166  for (int i = 0; i < size; i++) {
167  for (int j = 0; j < inputs.numCols(); j++) {
168  Column<Array<T>> col = inputs[j];
169  output.concatItem(i,
170  col[i]); // works only if i is the last row set, otherwise throws
171  }
172  }
173  return size;
174 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
void set_output_array_values_total_number(int32_t index, int64_t output_array_values_total_number)
Definition: heavydbTypes.h:361
DEVICE int64_t numCols() const
DEVICE int64_t size() const

+ Here is the call graph for this function:

template NEVER_INLINE HOST int32_t array_concat__cpu_template ( TableFunctionManager mgr,
const ColumnList< Array< float >> &  inputs,
Column< Array< float >> &  output 
)
template NEVER_INLINE HOST int32_t array_concat__cpu_template ( TableFunctionManager mgr,
const ColumnList< Array< double >> &  inputs,
Column< Array< double >> &  output 
)
template NEVER_INLINE HOST int32_t array_concat__cpu_template ( TableFunctionManager mgr,
const ColumnList< Array< int8_t >> &  inputs,
Column< Array< int8_t >> &  output 
)
template NEVER_INLINE HOST int32_t array_concat__cpu_template ( TableFunctionManager mgr,
const ColumnList< Array< int16_t >> &  inputs,
Column< Array< int16_t >> &  output 
)
template NEVER_INLINE HOST int32_t array_concat__cpu_template ( TableFunctionManager mgr,
const ColumnList< Array< int32_t >> &  inputs,
Column< Array< int32_t >> &  output 
)
template NEVER_INLINE HOST int32_t array_concat__cpu_template ( TableFunctionManager mgr,
const ColumnList< Array< int64_t >> &  inputs,
Column< Array< int64_t >> &  output 
)
template NEVER_INLINE HOST int32_t array_concat__cpu_template ( TableFunctionManager mgr,
const ColumnList< Array< bool >> &  inputs,
Column< Array< bool >> &  output 
)
template NEVER_INLINE HOST int32_t array_concat__cpu_template ( TableFunctionManager mgr,
const ColumnList< Array< TextEncodingDict >> &  inputs,
Column< Array< TextEncodingDict >> &  output 
)
template<typename T >
NEVER_INLINE HOST int32_t array_copier__cpu_template ( TableFunctionManager mgr,
const Column< Array< T >> &  input,
Column< Array< T >> &  output 
)

Definition at line 89 of file ArrayTestTableFunctions.cpp.

References TableFunctionManager::set_output_array_values_total_number(), and TableFunctionManager::set_output_row_size().

91  {
92  int size = input.size();
93 
94  // count the number of items in all input arrays:
95  int output_values_size = 0;
96  for (int i = 0; i < size; i++) {
97  output_values_size += input[i].size();
98  }
99 
100  // set the size and allocate the output columns buffers:
102  /*output column index=*/0,
103  /*upper bound to the number of items in all output arrays=*/output_values_size);
104  mgr.set_output_row_size(size);
105 
106  // set the items of output colums:
107  for (int i = 0; i < size; i++) {
108  output.setItem(i, input[i]);
109  }
110 
111  return size;
112 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
void set_output_array_values_total_number(int32_t index, int64_t output_array_values_total_number)
Definition: heavydbTypes.h:361
DEVICE int64_t size() const

+ Here is the call graph for this function:

template NEVER_INLINE HOST int32_t array_copier__cpu_template ( TableFunctionManager mgr,
const Column< Array< float >> &  input,
Column< Array< float >> &  output 
)
template NEVER_INLINE HOST int32_t array_copier__cpu_template ( TableFunctionManager mgr,
const Column< Array< double >> &  input,
Column< Array< double >> &  output 
)
template NEVER_INLINE HOST int32_t array_copier__cpu_template ( TableFunctionManager mgr,
const Column< Array< int8_t >> &  input,
Column< Array< int8_t >> &  output 
)
template NEVER_INLINE HOST int32_t array_copier__cpu_template ( TableFunctionManager mgr,
const Column< Array< int16_t >> &  input,
Column< Array< int16_t >> &  output 
)
template NEVER_INLINE HOST int32_t array_copier__cpu_template ( TableFunctionManager mgr,
const Column< Array< int32_t >> &  input,
Column< Array< int32_t >> &  output 
)
template NEVER_INLINE HOST int32_t array_copier__cpu_template ( TableFunctionManager mgr,
const Column< Array< int64_t >> &  input,
Column< Array< int64_t >> &  output 
)
template NEVER_INLINE HOST int32_t array_copier__cpu_template ( TableFunctionManager mgr,
const Column< Array< bool >> &  input,
Column< Array< bool >> &  output 
)
template NEVER_INLINE HOST int32_t array_copier__cpu_template ( TableFunctionManager mgr,
const Column< Array< TextEncodingDict >> &  input,
Column< Array< TextEncodingDict >> &  output 
)
template<typename T >
NEVER_INLINE HOST int32_t array_split__cpu_template ( TableFunctionManager mgr,
const Column< Array< T >> &  input,
Column< Array< T >> &  first,
Column< Array< T >> &  second 
)

Definition at line 328 of file ArrayTestTableFunctions.cpp.

References TableFunctionManager::set_output_array_values_total_number(), TableFunctionManager::set_output_row_size(), and Array< T >::size().

331  {
332  int size = input.size();
333  int first_values_size = 0;
334  int second_values_size = 0;
335  for (int i = 0; i < size; i++) {
336  if (!input.isNull(i)) {
337  int64_t sz = input[i].size();
338  first_values_size += sz / 2;
339  second_values_size += sz - sz / 2;
340  }
341  }
342  mgr.set_output_array_values_total_number(0, first_values_size);
343  mgr.set_output_array_values_total_number(1, second_values_size);
344  mgr.set_output_row_size(size);
345 
346  for (int i = 0; i < size; i++) {
347  if (input.isNull(i)) {
348  first.setNull(i);
349  second.setNull(i);
350  } else {
351  Array<T> arr = input[i];
352  int64_t sz = arr.size();
353  Array<T> arr1 = first.getItem(i, sz / 2);
354  Array<T> arr2 = second.getItem(i, sz - sz / 2);
355  for (int64_t j = 0; j < sz; j++) {
356  if (j < sz / 2) {
357  arr1[j] = arr[j];
358  } else {
359  arr2[j - sz / 2] = arr[j];
360  }
361  }
362  }
363  }
364  return size;
365 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
void set_output_array_values_total_number(int32_t index, int64_t output_array_values_total_number)
Definition: heavydbTypes.h:361
DEVICE int64_t size() const
DEVICE bool isNull(int64_t index) const
DEVICE void setNull(int64_t index)
DEVICE ALWAYS_INLINE size_t size() const
Definition: heavydbTypes.h:520

+ Here is the call graph for this function:

template NEVER_INLINE HOST int32_t array_split__cpu_template ( TableFunctionManager mgr,
const Column< Array< float >> &  input,
Column< Array< float >> &  first,
Column< Array< float >> &  second 
)
template NEVER_INLINE HOST int32_t array_split__cpu_template ( TableFunctionManager mgr,
const Column< Array< double >> &  input,
Column< Array< double >> &  first,
Column< Array< double >> &  second 
)
template NEVER_INLINE HOST int32_t array_split__cpu_template ( TableFunctionManager mgr,
const Column< Array< int8_t >> &  input,
Column< Array< int8_t >> &  first,
Column< Array< int8_t >> &  second 
)
template NEVER_INLINE HOST int32_t array_split__cpu_template ( TableFunctionManager mgr,
const Column< Array< int16_t >> &  input,
Column< Array< int16_t >> &  first,
Column< Array< int16_t >> &  second 
)
template NEVER_INLINE HOST int32_t array_split__cpu_template ( TableFunctionManager mgr,
const Column< Array< int32_t >> &  input,
Column< Array< int32_t >> &  first,
Column< Array< int32_t >> &  second 
)
template NEVER_INLINE HOST int32_t array_split__cpu_template ( TableFunctionManager mgr,
const Column< Array< int64_t >> &  input,
Column< Array< int64_t >> &  first,
Column< Array< int64_t >> &  second 
)
template NEVER_INLINE HOST int32_t array_split__cpu_template ( TableFunctionManager mgr,
const Column< Array< bool >> &  input,
Column< Array< bool >> &  first,
Column< Array< bool >> &  second 
)
template NEVER_INLINE HOST int32_t array_split__cpu_template ( TableFunctionManager mgr,
const Column< Array< TextEncodingDict >> &  input,
Column< Array< TextEncodingDict >> &  first,
Column< Array< TextEncodingDict >> &  second 
)
template<typename T >
NEVER_INLINE HOST int32_t sum_along_row__cpu_template ( const Column< Array< T >> &  input,
Column< T > &  output 
)

Definition at line 29 of file ArrayTestTableFunctions.cpp.

References TableFunctionManager::get_singleton(), Array< T >::isNull(), Column< T >::setNull(), Array< T >::size(), and heavydb.dtypes::T.

30  {
31  int size = input.size();
32  for (int i = 0; i < size; i++) {
33  const Array<T> arr = input[i];
34  if (arr.isNull()) {
35  output.setNull(i);
36  } else {
37  if constexpr (std::is_same<T, TextEncodingDict>::value) {
39  std::string acc = "";
40  for (size_t j = 0; j < arr.size(); j++) {
41  if (!arr.isNull(j)) {
42  acc += mgr->getString(input.getDictDbId(), input.getDictId(), arr[j]);
43  }
44  }
45  int32_t out_string_id =
46  mgr->getOrAddTransient(output.getDictDbId(), output.getDictId(), acc);
47  output[i] = out_string_id;
48  } else {
49  T acc{0};
50  for (size_t j = 0; j < arr.size(); j++) {
51  if constexpr (std::is_same_v<T, bool>) {
52  // todo: arr.isNull(i) returns arr[i] because bool does not
53  // have null value, we should introduce 8-bit boolean type
54  // for Arrays
55  acc |= arr[j];
56  } else {
57  if (!arr.isNull(j)) {
58  acc += arr[j];
59  }
60  }
61  }
62  output[i] = acc;
63  }
64  }
65  }
66  return size;
67 }
DEVICE int64_t size() const
DEVICE void setNull(int64_t index)
DEVICE ALWAYS_INLINE size_t size() const
Definition: heavydbTypes.h:520
static TableFunctionManager * get_singleton()
Definition: heavydbTypes.h:357
DEVICE bool isNull() const
Definition: heavydbTypes.h:556

+ Here is the call graph for this function:

template NEVER_INLINE HOST int32_t sum_along_row__cpu_template ( const Column< Array< float >> &  input,
Column< float > &  output 
)
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template ( const Column< Array< double >> &  input,
Column< double > &  output 
)
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template ( const Column< Array< int8_t >> &  input,
Column< int8_t > &  output 
)
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template ( const Column< Array< int16_t >> &  input,
Column< int16_t > &  output 
)
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template ( const Column< Array< int32_t >> &  input,
Column< int32_t > &  output 
)
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template ( const Column< Array< int64_t >> &  input,
Column< int64_t > &  output 
)
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template ( const Column< Array< bool >> &  input,
Column< bool > &  output 
)
template NEVER_INLINE HOST int32_t sum_along_row__cpu_template ( const Column< Array< TextEncodingDict >> &  input,
Column< TextEncodingDict > &  output 
)