OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OtherTestTableFunctions.cpp File Reference
#include "TableFunctionsTesting.h"
#include <algorithm>
+ Include dependency graph for OtherTestTableFunctions.cpp:

Go to the source code of this file.

Classes

struct  SortAsc< T >
 
struct  SortDesc< T >
 

Functions

template<typename T >
NEVER_INLINE HOST int32_t ct_binding_scalar_multiply__cpu_template (const Column< T > &input, const T multiplier, Column< T > &out)
 
template NEVER_INLINE HOST int32_t ct_binding_scalar_multiply__cpu_template (const Column< float > &input, const float multiplier, Column< float > &out)
 
template NEVER_INLINE HOST int32_t ct_binding_scalar_multiply__cpu_template (const Column< double > &input, const double multiplier, Column< double > &out)
 
template NEVER_INLINE HOST int32_t ct_binding_scalar_multiply__cpu_template (const Column< int32_t > &input, const int32_t multiplier, Column< int32_t > &out)
 
template NEVER_INLINE HOST int32_t ct_binding_scalar_multiply__cpu_template (const Column< int64_t > &input, const int64_t multiplier, Column< int64_t > &out)
 
template<typename T >
NEVER_INLINE HOST int32_t sort_column_limit__cpu_template (const Column< T > &input, const int32_t limit, const bool sort_ascending, const bool nulls_last, Column< T > &output)
 
template NEVER_INLINE HOST int32_t sort_column_limit__cpu_template (const Column< int8_t > &input, const int32_t limit, const bool sort_ascending, const bool nulls_last, Column< int8_t > &output)
 
template NEVER_INLINE HOST int32_t sort_column_limit__cpu_template (const Column< int16_t > &input, const int32_t limit, const bool sort_ascending, const bool nulls_last, Column< int16_t > &output)
 
template NEVER_INLINE HOST int32_t sort_column_limit__cpu_template (const Column< int32_t > &input, const int32_t limit, const bool sort_ascending, const bool nulls_last, Column< int32_t > &output)
 
template NEVER_INLINE HOST int32_t sort_column_limit__cpu_template (const Column< int64_t > &input, const int32_t limit, const bool sort_ascending, const bool nulls_last, Column< int64_t > &output)
 
template NEVER_INLINE HOST int32_t sort_column_limit__cpu_template (const Column< float > &input, const int32_t limit, const bool sort_ascending, const bool nulls_last, Column< float > &output)
 
template NEVER_INLINE HOST int32_t sort_column_limit__cpu_template (const Column< double > &input, const int32_t limit, const bool sort_ascending, const bool nulls_last, Column< double > &output)
 
template<typename T >
safe_addition (T x, T y)
 
template<typename T >
NEVER_INLINE HOST int32_t column_list_safe_row_sum__cpu_template (const ColumnList< T > &input, Column< T > &out)
 
template NEVER_INLINE HOST int32_t column_list_safe_row_sum__cpu_template (const ColumnList< int32_t > &input, Column< int32_t > &out)
 
template NEVER_INLINE HOST int32_t column_list_safe_row_sum__cpu_template (const ColumnList< int64_t > &input, Column< int64_t > &out)
 
template NEVER_INLINE HOST int32_t column_list_safe_row_sum__cpu_template (const ColumnList< float > &input, Column< float > &out)
 
template NEVER_INLINE HOST int32_t column_list_safe_row_sum__cpu_template (const ColumnList< double > &input, Column< double > &out)
 
EXTENSION_NOINLINE int32_t ct_sleep_worker (int32_t seconds, Column< int32_t > &output)
 
EXTENSION_NOINLINE_HOST int32_t ct_sleep1__cpu_ (int32_t seconds, int32_t mode, Column< int32_t > &output)
 
EXTENSION_NOINLINE_HOST int32_t ct_sleep2 (TableFunctionManager &mgr, int32_t seconds, int32_t mode, Column< int32_t > &output)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_throw_if_gt_100__cpu_template (TableFunctionManager &mgr, const Column< T > &input, Column< T > &output)
 
template NEVER_INLINE HOST int32_t ct_throw_if_gt_100__cpu_template (TableFunctionManager &mgr, const Column< float > &input, Column< float > &output)
 
template NEVER_INLINE HOST int32_t ct_throw_if_gt_100__cpu_template (TableFunctionManager &mgr, const Column< double > &input, Column< double > &output)
 
EXTENSION_NOINLINE_HOST int32_t ct_copy_and_add_size (TableFunctionManager &mgr, const Column< int32_t > &input, Column< int32_t > &output)
 
EXTENSION_NOINLINE_HOST int32_t ct_add_size_and_mul_alpha (TableFunctionManager &mgr, const Column< int32_t > &input1, const Column< int32_t > &input2, int32_t alpha, Column< int32_t > &output1, Column< int32_t > &output2)
 
EXTENSION_NOINLINE_HOST int32_t ct_sparse_add (TableFunctionManager &mgr, const Column< int32_t > &x1, const Column< int32_t > &d1, int32_t f1, const Column< int32_t > &x2, const Column< int32_t > &d2, int32_t f2, Column< int32_t > &x, Column< int32_t > &d)
 
EXTENSION_NOINLINE int32_t ct_test_nullable (const Column< int32_t > &input, const int32_t i, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_timestamp_extract (TableFunctionManager &mgr, const Column< Timestamp > &input, Column< int64_t > &ns, Column< int64_t > &us, Column< int64_t > &ms, Column< int64_t > &s, Column< int64_t > &m, Column< int64_t > &h, Column< int64_t > &d, Column< int64_t > &mo, Column< int64_t > &y)
 
EXTENSION_NOINLINE_HOST int32_t ct_timestamp_add_offset (TableFunctionManager &mgr, const Column< Timestamp > &input, const Timestamp offset, Column< Timestamp > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_timestamp_add_offset_cpu_only (const Column< Timestamp > &input, const int32_t multiplier, const Timestamp offset, Column< Timestamp > &out)
 
EXTENSION_NOINLINE int32_t ct_timestamp_test_columns_and_scalars__cpu (const Column< Timestamp > &input, const int64_t dummy, const int32_t multiplier, const Column< Timestamp > &input2, Column< Timestamp > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_timestamp_column_list_input (TableFunctionManager &mgr, const ColumnList< int64_t > &input, const Column< Timestamp > &input2, Column< int64_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_timestamp_truncate (TableFunctionManager &mgr, const Column< Timestamp > &input, Column< Timestamp > &y, Column< Timestamp > &mo, Column< Timestamp > &d, Column< Timestamp > &h, Column< Timestamp > &m, Column< Timestamp > &s, Column< Timestamp > &ms, Column< Timestamp > &us)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_timestamp_add_interval__template (TableFunctionManager &mgr, const Column< Timestamp > &input, const T inter, Column< Timestamp > &out)
 
template NEVER_INLINE HOST int32_t ct_timestamp_add_interval__template (TableFunctionManager &mgr, const Column< Timestamp > &input, const DayTimeInterval inter, Column< Timestamp > &out)
 
template NEVER_INLINE HOST int32_t ct_timestamp_add_interval__template (TableFunctionManager &mgr, const Column< Timestamp > &input, const YearMonthTimeInterval inter, Column< Timestamp > &out)
 
EXTENSION_NOINLINE int32_t row_copier (const Column< double > &input_col, int copy_multiplier, Column< double > &output_col)
 
EXTENSION_NOINLINE_HOST int32_t row_copier2__cpu__ (const Column< double > &input_col, int copy_multiplier, Column< double > &output_col, Column< double > &output_col2)
 
EXTENSION_NOINLINE_HOST int32_t row_copier_columnlist__cpu__ (TableFunctionManager &mgr, const ColumnList< double > &cols, Column< double > &output_col)
 
EXTENSION_NOINLINE int32_t row_copier_text (const Column< TextEncodingDict > &input_col, int copy_multiplier, Column< TextEncodingDict > &output_col)
 
EXTENSION_NOINLINE int32_t row_adder (const int copy_multiplier, const Column< double > &input_col1, const Column< double > &input_col2, Column< double > &output_col)
 
EXTENSION_NOINLINE int32_t row_addsub (const int copy_multiplier, const Column< double > &input_col1, const Column< double > &input_col2, Column< double > &output_col1, Column< double > &output_col2)
 
EXTENSION_NOINLINE_HOST int32_t get_max_with_row_offset__cpu_ (const Column< int > &input_col, Column< int > &output_max_col, Column< int > &output_max_row_col)
 
EXTENSION_NOINLINE_HOST int32_t column_list_get__cpu_ (const ColumnList< double > &col_list, const int index, const int m, Column< double > &col)
 
EXTENSION_NOINLINE int32_t column_list_first_last (const ColumnList< double > &col_list, const int m, Column< double > &col1, Column< double > &col2)
 
EXTENSION_NOINLINE_HOST int32_t column_list_row_sum__cpu_ (const ColumnList< int32_t > &input, Column< int32_t > &out)
 
NEVER_INLINE HOST int32_t tf_metadata_setter__cpu_template (TableFunctionManager &mgr, Column< bool > &success)
 
NEVER_INLINE HOST int32_t tf_metadata_setter_repeated__cpu_template (TableFunctionManager &mgr, Column< bool > &success)
 
NEVER_INLINE HOST int32_t tf_metadata_setter_size_mismatch__cpu_template (TableFunctionManager &mgr, Column< bool > &success)
 
NEVER_INLINE HOST int32_t tf_metadata_getter__cpu_template (TableFunctionManager &mgr, const Column< bool > &input, Column< bool > &success)
 
NEVER_INLINE HOST int32_t tf_metadata_getter_bad__cpu_template (TableFunctionManager &mgr, const Column< bool > &input, Column< bool > &success)
 
EXTENSION_NOINLINE int32_t ct_gpu_default_init__gpu_ (Column< int32_t > &output_buffer)
 
EXTENSION_NOINLINE int32_t ct_test_func__cpu_1 (const Column< int32_t > &input1, const int32_t x, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE int32_t ct_test_func__cpu_2 (const Column< int32_t > &input1, const Column< int32_t > &input2, const int32_t multiplier, Column< int32_t > &out)
 
template<typename T >
TEMPLATE_NOINLINE int32_t row_repeater__cpu_template (TableFunctionManager &mgr, const Column< T > &input_col, const int reps, Column< T > &output_col)
 
template TEMPLATE_NOINLINE int32_t row_repeater__cpu_template (TableFunctionManager &mgr, const Column< int8_t > &input_col, const int reps, Column< int8_t > &output_col)
 
template TEMPLATE_NOINLINE int32_t row_repeater__cpu_template (TableFunctionManager &mgr, const Column< int16_t > &input_col, const int reps, Column< int16_t > &output_col)
 
template TEMPLATE_NOINLINE int32_t row_repeater__cpu_template (TableFunctionManager &mgr, const Column< int32_t > &input_col, const int reps, Column< int32_t > &output_col)
 
template TEMPLATE_NOINLINE int32_t row_repeater__cpu_template (TableFunctionManager &mgr, const Column< int64_t > &input_col, const int reps, Column< int64_t > &output_col)
 
template TEMPLATE_NOINLINE int32_t row_repeater__cpu_template (TableFunctionManager &mgr, const Column< float > &input_col, const int reps, Column< float > &output_col)
 
template TEMPLATE_NOINLINE int32_t row_repeater__cpu_template (TableFunctionManager &mgr, const Column< double > &input_col, const int reps, Column< double > &output_col)
 
template TEMPLATE_NOINLINE int32_t row_repeater__cpu_template (TableFunctionManager &mgr, const Column< bool > &input_col, const int reps, Column< bool > &output_col)
 

Function Documentation

EXTENSION_NOINLINE int32_t column_list_first_last ( const ColumnList< double > &  col_list,
const int  m,
Column< double > &  col1,
Column< double > &  col2 
)

Definition at line 831 of file OtherTestTableFunctions.cpp.

References ColumnList< T >::numCols(), and Column< T >::size().

834  {
835  col1 = col_list[0];
836  col2 = col_list[col_list.numCols() - 1];
837  return col1.size();
838 }
DEVICE int64_t size() const
DEVICE int64_t numCols() const

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t column_list_get__cpu_ ( const ColumnList< double > &  col_list,
const int  index,
const int  m,
Column< double > &  col 
)

Definition at line 821 of file OtherTestTableFunctions.cpp.

References Column< T >::size().

824  {
825  col = col_list[index]; // copy the data of col_list item to output column
826  return col.size();
827 }
DEVICE int64_t size() const

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t column_list_row_sum__cpu_ ( const ColumnList< int32_t > &  input,
Column< int32_t > &  out 
)

Definition at line 843 of file OtherTestTableFunctions.cpp.

References ColumnList< T >::numCols(), and set_output_row_size().

843  {
844  int32_t output_num_rows = input.numCols();
845  set_output_row_size(output_num_rows);
846  for (int i = 0; i < output_num_rows; i++) {
847  auto col = input[i];
848  int32_t s = 0;
849  for (int j = 0; j < col.size(); j++) {
850  s += col[j];
851  }
852  out[i] = s;
853  }
854  return output_num_rows;
855 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t numCols() const

+ Here is the call graph for this function:

template<typename T >
NEVER_INLINE HOST int32_t column_list_safe_row_sum__cpu_template ( const ColumnList< T > &  input,
Column< T > &  out 
)

Definition at line 178 of file OtherTestTableFunctions.cpp.

References ColumnList< T >::numCols(), safe_addition(), set_output_row_size(), heavydb.dtypes::T, and TABLE_FUNCTION_ERROR.

178  {
179  int32_t output_num_rows = input.numCols();
180  set_output_row_size(output_num_rows);
181  for (int i = 0; i < output_num_rows; i++) {
182  auto col = input[i];
183  T s = 0;
184  for (int j = 0; j < col.size(); j++) {
185  try {
186  s = safe_addition(s, col[j]);
187  } catch (const std::exception& e) {
188  return TABLE_FUNCTION_ERROR(e.what());
189  } catch (...) {
190  return TABLE_FUNCTION_ERROR("Unknown error");
191  }
192  }
193  out[i] = s;
194  }
195  return output_num_rows;
196 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t numCols() const
T safe_addition(T x, T y)
#define TABLE_FUNCTION_ERROR(MSG)
Definition: heavydbTypes.h:74

+ Here is the call graph for this function:

template NEVER_INLINE HOST int32_t column_list_safe_row_sum__cpu_template ( const ColumnList< int32_t > &  input,
Column< int32_t > &  out 
)
template NEVER_INLINE HOST int32_t column_list_safe_row_sum__cpu_template ( const ColumnList< int64_t > &  input,
Column< int64_t > &  out 
)
template NEVER_INLINE HOST int32_t column_list_safe_row_sum__cpu_template ( const ColumnList< float > &  input,
Column< float > &  out 
)
template NEVER_INLINE HOST int32_t column_list_safe_row_sum__cpu_template ( const ColumnList< double > &  input,
Column< double > &  out 
)
EXTENSION_NOINLINE_HOST int32_t ct_add_size_and_mul_alpha ( TableFunctionManager mgr,
const Column< int32_t > &  input1,
const Column< int32_t > &  input2,
int32_t  alpha,
Column< int32_t > &  output1,
Column< int32_t > &  output2 
)

Definition at line 325 of file OtherTestTableFunctions.cpp.

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

330  {
331  auto size = input1.size();
332  mgr.set_output_row_size(size);
333  for (int32_t i = 0; i < size; i++) {
334  output1[i] = input1[i] + size;
335  output2[i] = input2[i] * alpha;
336  }
337  return size;
338 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const

+ Here is the call graph for this function:

template<typename T >
NEVER_INLINE HOST int32_t ct_binding_scalar_multiply__cpu_template ( const Column< T > &  input,
const T  multiplier,
Column< T > &  out 
)

Definition at line 29 of file OtherTestTableFunctions.cpp.

References Column< T >::isNull(), set_output_row_size(), Column< T >::setNull(), and Column< T >::size().

31  {
32  const int64_t num_rows = input.size();
33  set_output_row_size(num_rows);
34  for (int64_t r = 0; r < num_rows; ++r) {
35  if (!input.isNull(r)) {
36  out[r] = input[r] * multiplier;
37  } else {
38  out.setNull(r);
39  }
40  }
41  return num_rows;
42 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
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 ct_binding_scalar_multiply__cpu_template ( const Column< float > &  input,
const float  multiplier,
Column< float > &  out 
)
template NEVER_INLINE HOST int32_t ct_binding_scalar_multiply__cpu_template ( const Column< double > &  input,
const double  multiplier,
Column< double > &  out 
)
template NEVER_INLINE HOST int32_t ct_binding_scalar_multiply__cpu_template ( const Column< int32_t > &  input,
const int32_t  multiplier,
Column< int32_t > &  out 
)
template NEVER_INLINE HOST int32_t ct_binding_scalar_multiply__cpu_template ( const Column< int64_t > &  input,
const int64_t  multiplier,
Column< int64_t > &  out 
)
EXTENSION_NOINLINE_HOST int32_t ct_copy_and_add_size ( TableFunctionManager mgr,
const Column< int32_t > &  input,
Column< int32_t > &  output 
)

Definition at line 315 of file OtherTestTableFunctions.cpp.

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

317  {
318  mgr.set_output_row_size(input.size());
319  for (int32_t i = 0; i < input.size(); i++) {
320  output[i] = input[i] + input.size();
321  }
322  return output.size();
323 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_gpu_default_init__gpu_ ( Column< int32_t > &  output_buffer)

Definition at line 953 of file OtherTestTableFunctions.cpp.

953  {
954  // output_buffer[0] should always be 0 due to default initialization for GPU
955  return 1;
956 }
EXTENSION_NOINLINE_HOST int32_t ct_sleep1__cpu_ ( int32_t  seconds,
int32_t  mode,
Column< int32_t > &  output 
)

Definition at line 232 of file OtherTestTableFunctions.cpp.

References ct_sleep_worker(), TableFunctionManager::get_singleton(), set_output_row_size(), Column< T >::size(), and TABLE_FUNCTION_ERROR.

234  {
235  switch (mode) {
236  case 0: {
237  set_output_row_size(3); // uses global singleton of TableFunctionManager
238  break;
239  }
240  case 1: {
242  mgr->set_output_row_size(3);
243  break;
244  }
245  case 2:
246  case 3: {
247  break;
248  }
249  default:
250  return TABLE_FUNCTION_ERROR("unexpected mode");
251  }
252  if (output.size() == 0) {
253  return TABLE_FUNCTION_ERROR("unspecified output columns row size");
254  }
255  return ct_sleep_worker(seconds, output);
256 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
EXTENSION_NOINLINE int32_t ct_sleep_worker(int32_t seconds, Column< int32_t > &output)
#define TABLE_FUNCTION_ERROR(MSG)
Definition: heavydbTypes.h:74
static TableFunctionManager * get_singleton()
Definition: heavydbTypes.h:357

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_sleep2 ( TableFunctionManager mgr,
int32_t  seconds,
int32_t  mode,
Column< int32_t > &  output 
)

Definition at line 258 of file OtherTestTableFunctions.cpp.

References ct_sleep_worker(), TableFunctionManager::get_singleton(), TableFunctionManager::set_output_row_size(), and Column< T >::size().

261  {
262  switch (mode) {
263  case 0:
264  case 1: {
265  mgr.set_output_row_size(3); // uses thread-safe TableFunctionManager instance
266  break;
267  }
268  case 2: {
269  break;
270  }
271  case 3: {
272  try {
273  auto* mgr0 = TableFunctionManager::get_singleton(); // it may throw "singleton is
274  // not initialized"
275  mgr0->set_output_row_size(3);
276  } catch (std::exception& e) {
277  return mgr.ERROR_MESSAGE(e.what());
278  }
279  break;
280  }
281  default:
282  return mgr.ERROR_MESSAGE("unexpected mode");
283  }
284  if (output.size() == 0) {
285  return mgr.ERROR_MESSAGE("unspecified output columns row size");
286  }
287  return ct_sleep_worker(seconds, output);
288 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const
EXTENSION_NOINLINE int32_t ct_sleep_worker(int32_t seconds, Column< int32_t > &output)
static TableFunctionManager * get_singleton()
Definition: heavydbTypes.h:357

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_sleep_worker ( int32_t  seconds,
Column< int32_t > &  output 
)

Definition at line 214 of file OtherTestTableFunctions.cpp.

Referenced by ct_sleep1__cpu_(), and ct_sleep2().

214  {
215  // save entering time
216  output[0] = std::chrono::duration_cast<std::chrono::milliseconds>(
217  std::chrono::system_clock::now().time_since_epoch())
218  .count() &
219  0xffffff;
220  // store thread id info
221  output[2] = std::hash<std::thread::id>()(std::this_thread::get_id()) & 0xffff;
222  // do "computations" for given seconds
223  std::this_thread::sleep_for(std::chrono::seconds(seconds));
224  // save leaving time
225  output[1] = std::chrono::duration_cast<std::chrono::milliseconds>(
226  std::chrono::system_clock::now().time_since_epoch())
227  .count() &
228  0xffffff;
229  return 3;
230 }

+ Here is the caller graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_sparse_add ( TableFunctionManager mgr,
const Column< int32_t > &  x1,
const Column< int32_t > &  d1,
int32_t  f1,
const Column< int32_t > &  x2,
const Column< int32_t > &  d2,
int32_t  f2,
Column< int32_t > &  x,
Column< int32_t > &  d 
)

Definition at line 347 of file OtherTestTableFunctions.cpp.

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

355  {
356  // sorted set of common coordinates:
357  std::set<int32_t, std::less<int32_t>> x12;
358  // inverse map of coordinates and indices, keys are sorted:
359  std::map<int32_t, int32_t, std::less<int32_t>> i1, i2;
360 
361  for (int32_t i = 0; i < x1.size(); i++) {
362  i1[x1[i]] = i;
363  x12.insert(x1[i]);
364  }
365  for (int32_t i = 0; i < x2.size(); i++) {
366  i2[x2[i]] = i;
367  x12.insert(x2[i]);
368  }
369  auto size = x12.size();
370 
371  mgr.set_output_row_size(size);
372  int32_t k = 0;
373  for (auto x_ : x12) {
374  x[k] = x_;
375  auto i1_ = i1.find(x_);
376  auto i2_ = i2.find(x_);
377  if (i1_ != i1.end()) {
378  if (i2_ != i2.end()) {
379  d[k] = d1[i1_->second] + d2[i2_->second];
380  } else {
381  d[k] = d1[i1_->second] + f2;
382  }
383  } else if (i2_ != i2.end()) {
384  d[k] = f1 + d2[i2_->second];
385  } else {
386  d[k] = f1 + f2;
387  }
388  d[k] *= size;
389  k++;
390  }
391  return size;
392 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_test_func__cpu_1 ( const Column< int32_t > &  input1,
const int32_t  x,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 958 of file OtherTestTableFunctions.cpp.

961  {
962  out[0] = 123;
963  return 1;
964 }
EXTENSION_NOINLINE int32_t ct_test_func__cpu_2 ( const Column< int32_t > &  input1,
const Column< int32_t > &  input2,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 966 of file OtherTestTableFunctions.cpp.

969  {
970  out[0] = 234;
971  return 1;
972 }
EXTENSION_NOINLINE int32_t ct_test_nullable ( const Column< int32_t > &  input,
const int32_t  i,
Column< int32_t > &  out 
)

Definition at line 414 of file OtherTestTableFunctions.cpp.

References Column< T >::setNull(), and Column< T >::size().

416  {
417  for (int i = 0; i < input.size(); i++) {
418  if (i % 2 == 0) {
419  out.setNull(i);
420  } else {
421  out[i] = input[i];
422  }
423  }
424  return input.size();
425 }
DEVICE int64_t size() const
DEVICE void setNull(int64_t index)

+ Here is the call graph for this function:

template<typename T >
NEVER_INLINE HOST int32_t ct_throw_if_gt_100__cpu_template ( TableFunctionManager mgr,
const Column< T > &  input,
Column< T > &  output 
)

Definition at line 291 of file OtherTestTableFunctions.cpp.

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

293  {
294  int64_t num_rows = input.size();
295  mgr.set_output_row_size(num_rows);
296  for (int64_t r = 0; r < num_rows; ++r) {
297  if (input[r] > 100) {
298  return mgr.ERROR_MESSAGE("Values greater than 100 not allowed");
299  }
300  output[r] = input[r];
301  }
302  return num_rows;
303 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const

+ Here is the call graph for this function:

template NEVER_INLINE HOST int32_t ct_throw_if_gt_100__cpu_template ( TableFunctionManager mgr,
const Column< float > &  input,
Column< float > &  output 
)
template NEVER_INLINE HOST int32_t ct_throw_if_gt_100__cpu_template ( TableFunctionManager mgr,
const Column< double > &  input,
Column< double > &  output 
)
template<typename T >
NEVER_INLINE HOST int32_t ct_timestamp_add_interval__template ( TableFunctionManager mgr,
const Column< Timestamp > &  input,
const T  inter,
Column< Timestamp > &  out 
)

Definition at line 569 of file OtherTestTableFunctions.cpp.

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

572  {
573  int size = input.size();
574  mgr.set_output_row_size(size);
575  for (int i = 0; i < size; ++i) {
576  out[i] = inter + input[i];
577  }
578  return size;
579 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const

+ Here is the call graph for this function:

template NEVER_INLINE HOST int32_t ct_timestamp_add_interval__template ( TableFunctionManager mgr,
const Column< Timestamp > &  input,
const DayTimeInterval  inter,
Column< Timestamp > &  out 
)
template NEVER_INLINE HOST int32_t ct_timestamp_add_interval__template ( TableFunctionManager mgr,
const Column< Timestamp > &  input,
const YearMonthTimeInterval  inter,
Column< Timestamp > &  out 
)
EXTENSION_NOINLINE_HOST int32_t ct_timestamp_add_offset ( TableFunctionManager mgr,
const Column< Timestamp > &  input,
const Timestamp  offset,
Column< Timestamp > &  out 
)

Definition at line 471 of file OtherTestTableFunctions.cpp.

References Column< T >::isNull(), TableFunctionManager::set_output_row_size(), Column< T >::setNull(), and Column< T >::size().

474  {
475  int size = input.size();
476  mgr.set_output_row_size(size);
477  for (int i = 0; i < size; ++i) {
478  if (input.isNull(i)) {
479  out.setNull(i);
480  } else {
481  out[i] = input[i] + offset;
482  }
483  }
484  return size;
485 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const
DEVICE bool isNull(int64_t index) const
DEVICE void setNull(int64_t index)

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_timestamp_add_offset_cpu_only ( const Column< Timestamp > &  input,
const int32_t  multiplier,
const Timestamp  offset,
Column< Timestamp > &  out 
)

Definition at line 504 of file OtherTestTableFunctions.cpp.

507  {
508  out[0] = input[0] + offset;
509  return 1;
510 }
EXTENSION_NOINLINE_HOST int32_t ct_timestamp_column_list_input ( TableFunctionManager mgr,
const ColumnList< int64_t > &  input,
const Column< Timestamp > &  input2,
Column< int64_t > &  out 
)

Definition at line 532 of file OtherTestTableFunctions.cpp.

References TableFunctionManager::set_output_row_size().

535  {
536  mgr.set_output_row_size(1);
537  out[0] = 1;
538  return 1;
539 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_timestamp_extract ( TableFunctionManager mgr,
const Column< Timestamp > &  input,
Column< int64_t > &  ns,
Column< int64_t > &  us,
Column< int64_t > &  ms,
Column< int64_t > &  s,
Column< int64_t > &  m,
Column< int64_t > &  h,
Column< int64_t > &  d,
Column< int64_t > &  mo,
Column< int64_t > &  y 
)

Definition at line 431 of file OtherTestTableFunctions.cpp.

References Column< T >::isNull(), TableFunctionManager::set_output_row_size(), Column< T >::setNull(), and Column< T >::size().

441  {
442  int size = input.size();
443  mgr.set_output_row_size(size);
444  for (int i = 0; i < size; ++i) {
445  if (input.isNull(i)) {
446  ns.setNull(i);
447  us.setNull(i);
448  ms.setNull(i);
449  s.setNull(i);
450  m.setNull(i);
451  h.setNull(i);
452  d.setNull(i);
453  mo.setNull(i);
454  y.setNull(i);
455  } else {
456  ns[i] = input[i].getNanoseconds();
457  us[i] = input[i].getMicroseconds();
458  ms[i] = input[i].getMilliseconds();
459  s[i] = input[i].getSeconds();
460  m[i] = input[i].getMinutes();
461  h[i] = input[i].getHours();
462  d[i] = input[i].getDay();
463  mo[i] = input[i].getMonth();
464  y[i] = input[i].getYear();
465  }
466  }
467  return size;
468 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const
DEVICE bool isNull(int64_t index) const
DEVICE void setNull(int64_t index)

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_timestamp_test_columns_and_scalars__cpu ( const Column< Timestamp > &  input,
const int64_t  dummy,
const int32_t  multiplier,
const Column< Timestamp > &  input2,
Column< Timestamp > &  out 
)

Definition at line 514 of file OtherTestTableFunctions.cpp.

References Column< T >::isNull(), Column< T >::setNull(), and Column< T >::size().

518  {
519  int size = input.size();
520  for (int i = 0; i < size; ++i) {
521  if (input.isNull(i)) {
522  out.setNull(i);
523  } else {
524  out[i] = input[i] + input2[i] + Timestamp(dummy);
525  }
526  }
527  return size;
528 }
DEVICE int64_t size() const
DEVICE bool isNull(int64_t index) const
DEVICE void setNull(int64_t index)

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_timestamp_truncate ( TableFunctionManager mgr,
const Column< Timestamp > &  input,
Column< Timestamp > &  y,
Column< Timestamp > &  mo,
Column< Timestamp > &  d,
Column< Timestamp > &  h,
Column< Timestamp > &  m,
Column< Timestamp > &  s,
Column< Timestamp > &  ms,
Column< Timestamp > &  us 
)

Definition at line 541 of file OtherTestTableFunctions.cpp.

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

550  {
551  int size = input.size();
552  mgr.set_output_row_size(size);
553  for (int i = 0; i < size; ++i) {
554  y[i] = input[i].truncateToYear();
555  mo[i] = input[i].truncateToMonth();
556  d[i] = input[i].truncateToDay();
557  h[i] = input[i].truncateToHours();
558  m[i] = input[i].truncateToMinutes();
559  s[i] = input[i].truncateToSeconds();
560  ms[i] = input[i].truncateToMilliseconds();
561  us[i] = input[i].truncateToMicroseconds();
562  }
563 
564  return size;
565 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t get_max_with_row_offset__cpu_ ( const Column< int > &  input_col,
Column< int > &  output_max_col,
Column< int > &  output_max_row_col 
)

Definition at line 794 of file OtherTestTableFunctions.cpp.

References Column< T >::size().

796  {
797  if ((output_max_col.size() != 1) || output_max_row_col.size() != 1) {
798  return -1;
799  }
800  auto start = 0;
801  auto stop = input_col.size();
802  auto step = 1;
803 
804  int curr_max = -2147483648;
805  int curr_max_row = -1;
806  for (auto i = start; i < stop; i += step) {
807  if (input_col[i] > curr_max) {
808  curr_max = input_col[i];
809  curr_max_row = i;
810  }
811  }
812  output_max_col[0] = curr_max;
813  output_max_row_col[0] = curr_max_row;
814  return 1;
815 }
DEVICE int64_t size() const

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t row_adder ( const int  copy_multiplier,
const Column< double > &  input_col1,
const Column< double > &  input_col2,
Column< double > &  output_col 
)

Definition at line 721 of file OtherTestTableFunctions.cpp.

References Column< T >::isNull(), Column< T >::setNull(), and Column< T >::size().

724  {
725  int32_t output_row_count = copy_multiplier * input_col1.size();
726  if (output_row_count > 100) {
727  // Test failure propagation.
728  return -1;
729  }
730  if (output_col.size() != output_row_count) {
731  return -1;
732  }
733 
734 #ifdef __CUDACC__
735  int32_t start = threadIdx.x + blockDim.x * blockIdx.x;
736  int32_t stop = static_cast<int32_t>(input_col1.size());
737  int32_t step = blockDim.x * gridDim.x;
738 #else
739  auto start = 0;
740  auto stop = input_col1.size();
741  auto step = 1;
742 #endif
743  auto stride = input_col1.size();
744  for (auto i = start; i < stop; i += step) {
745  for (int c = 0; c < copy_multiplier; c++) {
746  if (input_col1.isNull(i) || input_col2.isNull(i)) {
747  output_col.setNull(i + (c * stride));
748  } else {
749  output_col[i + (c * stride)] = input_col1[i] + input_col2[i];
750  }
751  }
752  }
753 
754  return output_row_count;
755 }
DEVICE int64_t size() const
DEVICE bool isNull(int64_t index) const
DEVICE void setNull(int64_t index)

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t row_addsub ( const int  copy_multiplier,
const Column< double > &  input_col1,
const Column< double > &  input_col2,
Column< double > &  output_col1,
Column< double > &  output_col2 
)

Definition at line 757 of file OtherTestTableFunctions.cpp.

References Column< T >::size().

761  {
762  int32_t output_row_count = copy_multiplier * input_col1.size();
763  if (output_row_count > 100) {
764  // Test failure propagation.
765  return -1;
766  }
767  if ((output_col1.size() != output_row_count) ||
768  (output_col2.size() != output_row_count)) {
769  return -1;
770  }
771 
772 #ifdef __CUDACC__
773  int32_t start = threadIdx.x + blockDim.x * blockIdx.x;
774  int32_t stop = static_cast<int32_t>(input_col1.size());
775  int32_t step = blockDim.x * gridDim.x;
776 #else
777  auto start = 0;
778  auto stop = input_col1.size();
779  auto step = 1;
780 #endif
781  auto stride = input_col1.size();
782  for (auto i = start; i < stop; i += step) {
783  for (int c = 0; c < copy_multiplier; c++) {
784  output_col1[i + (c * stride)] = input_col1[i] + input_col2[i];
785  output_col2[i + (c * stride)] = input_col1[i] - input_col2[i];
786  }
787  }
788  return output_row_count;
789 }
DEVICE int64_t size() const

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t row_copier ( const Column< double > &  input_col,
int  copy_multiplier,
Column< double > &  output_col 
)

Definition at line 596 of file OtherTestTableFunctions.cpp.

References Column< T >::size().

Referenced by row_copier2__cpu__().

598  {
599  int32_t output_row_count = copy_multiplier * input_col.size();
600  if (output_row_count > 100) {
601  // Test failure propagation.
602  return -1;
603  }
604  if (output_col.size() != output_row_count) {
605  return -1;
606  }
607 
608 #ifdef __CUDACC__
609  int32_t start = threadIdx.x + blockDim.x * blockIdx.x;
610  int32_t stop = static_cast<int32_t>(input_col.size());
611  int32_t step = blockDim.x * gridDim.x;
612 #else
613  auto start = 0;
614  auto stop = input_col.size();
615  auto step = 1;
616 #endif
617 
618  for (auto i = start; i < stop; i += step) {
619  for (int c = 0; c < copy_multiplier; c++) {
620  output_col[i + (c * input_col.size())] = input_col[i];
621  }
622  }
623 
624  return output_row_count;
625 }
DEVICE int64_t size() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

EXTENSION_NOINLINE_HOST int32_t row_copier2__cpu__ ( const Column< double > &  input_col,
int  copy_multiplier,
Column< double > &  output_col,
Column< double > &  output_col2 
)

Definition at line 629 of file OtherTestTableFunctions.cpp.

References run_benchmark_import::result, row_copier(), set_output_row_size(), and Column< T >::size().

632  {
633  if (copy_multiplier == -1) {
634  // Test UDTF return without allocating output columns, expect
635  // empty output columns.
636  return 0;
637  }
638  if (copy_multiplier == -2) {
639  // Test UDTF return without allocating output columns but
640  // returning positive row size, expect runtime error.
641  return 1;
642  }
643 #ifndef __CUDACC__
644  if (copy_multiplier == -3) {
645  // Test UDTF throw before allocating output columns, expect
646  // runtime error.
647  throw std::runtime_error("row_copier2: throw before calling set_output_row_size");
648  }
649  if (copy_multiplier == -4) {
650  // Test UDTF throw after allocating output columns, expect
651  // runtime error.
653  throw std::runtime_error("row_copier2: throw after calling set_output_row_size");
654  }
655 #endif
656  if (copy_multiplier == -5) {
657  // Test UDTF setting negative row size, expect runtime error.
659  }
660  int32_t output_row_count = copy_multiplier * input_col.size();
661  /* set_output_row_size can be used only when an UDTF is executed on CPU */
662  set_output_row_size(output_row_count);
663  auto result = row_copier(input_col, copy_multiplier, output_col);
664  if (result >= 0) {
665  result = row_copier(input_col, copy_multiplier, output_col2);
666  }
667  return result;
668 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
EXTENSION_NOINLINE int32_t row_copier(const Column< double > &input_col, int copy_multiplier, Column< double > &output_col)

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t row_copier_columnlist__cpu__ ( TableFunctionManager mgr,
const ColumnList< double > &  cols,
Column< double > &  output_col 
)

Definition at line 671 of file OtherTestTableFunctions.cpp.

References ColumnList< T >::numCols(), TableFunctionManager::set_output_row_size(), and ColumnList< T >::size().

673  {
674  int32_t output_row_count = 0;
675  for (int i = 0; i < cols.numCols(); ++i) {
676  output_row_count += cols[i].size();
677  }
678  mgr.set_output_row_size(output_row_count);
679  int idx = 0;
680  for (int i = 0; i < cols.numCols(); ++i) {
681  for (int j = 0; j < cols[i].size(); ++j) {
682  output_col[idx++] = cols[i][j];
683  }
684  }
685  return output_row_count;
686 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t numCols() const
DEVICE int64_t size() const

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t row_copier_text ( const Column< TextEncodingDict > &  input_col,
int  copy_multiplier,
Column< TextEncodingDict > &  output_col 
)

Definition at line 690 of file OtherTestTableFunctions.cpp.

References Column< TextEncodingDict >::size().

692  {
693  int32_t output_row_count = copy_multiplier * input_col.size();
694  if (output_row_count > 100) {
695  // Test failure propagation.
696  return -1;
697  }
698  if (output_col.size() != output_row_count) {
699  return -2;
700  }
701 
702 #ifdef __CUDACC__
703  int32_t start = threadIdx.x + blockDim.x * blockIdx.x;
704  int32_t stop = static_cast<int32_t>(input_col.size());
705  int32_t step = blockDim.x * gridDim.x;
706 #else
707  auto start = 0;
708  auto stop = input_col.size();
709  auto step = 1;
710 #endif
711 
712  for (auto i = start; i < stop; i += step) {
713  for (int c = 0; c < copy_multiplier; c++) {
714  output_col[i + (c * input_col.size())] = input_col[i];
715  }
716  }
717 
718  return output_row_count;
719 }
DEVICE int64_t size() const

+ Here is the call graph for this function:

template<typename T >
TEMPLATE_NOINLINE int32_t row_repeater__cpu_template ( TableFunctionManager mgr,
const Column< T > &  input_col,
const int  reps,
Column< T > &  output_col 
)

Definition at line 976 of file OtherTestTableFunctions.cpp.

References TableFunctionManager::set_output_row_size(), Column< T >::size(), and SUCCESS.

979  {
980  // Equivalent to row_copier but supports output row sizes larger
981  // than MAX_INT
982  size_t output_row_count = input_col.size() * reps;
983  mgr.set_output_row_size(output_row_count);
984 
985  auto start = 0;
986  auto stop = input_col.size();
987  auto step = 1;
988 
989  for (auto i = start; i < stop; i += step) {
990  for (int c = 0; c < reps; c++) {
991  output_col[i + (stop * c)] = input_col[i];
992  }
993  }
994 
995  return SUCCESS;
996 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const
#define SUCCESS
Definition: heavydbTypes.h:76

+ Here is the call graph for this function:

template TEMPLATE_NOINLINE int32_t row_repeater__cpu_template ( TableFunctionManager mgr,
const Column< int8_t > &  input_col,
const int  reps,
Column< int8_t > &  output_col 
)
template TEMPLATE_NOINLINE int32_t row_repeater__cpu_template ( TableFunctionManager mgr,
const Column< int16_t > &  input_col,
const int  reps,
Column< int16_t > &  output_col 
)
template TEMPLATE_NOINLINE int32_t row_repeater__cpu_template ( TableFunctionManager mgr,
const Column< int32_t > &  input_col,
const int  reps,
Column< int32_t > &  output_col 
)
template TEMPLATE_NOINLINE int32_t row_repeater__cpu_template ( TableFunctionManager mgr,
const Column< int64_t > &  input_col,
const int  reps,
Column< int64_t > &  output_col 
)
template TEMPLATE_NOINLINE int32_t row_repeater__cpu_template ( TableFunctionManager mgr,
const Column< float > &  input_col,
const int  reps,
Column< float > &  output_col 
)
template TEMPLATE_NOINLINE int32_t row_repeater__cpu_template ( TableFunctionManager mgr,
const Column< double > &  input_col,
const int  reps,
Column< double > &  output_col 
)
template TEMPLATE_NOINLINE int32_t row_repeater__cpu_template ( TableFunctionManager mgr,
const Column< bool > &  input_col,
const int  reps,
Column< bool > &  output_col 
)
template<typename T >
T safe_addition ( x,
y 
)

Definition at line 161 of file OtherTestTableFunctions.cpp.

Referenced by column_list_safe_row_sum__cpu_template().

161  {
162  if (x >= 0) {
163  if (y > (std::numeric_limits<T>::max() - x)) {
164  throw std::overflow_error("Addition overflow detected");
165  }
166  } else {
167  if (y < (std::numeric_limits<T>::min() - x)) {
168  throw std::underflow_error("Addition underflow detected");
169  }
170  }
171  return x + y;
172 }

+ Here is the caller graph for this function:

template<typename T >
NEVER_INLINE HOST int32_t sort_column_limit__cpu_template ( const Column< T > &  input,
const int32_t  limit,
const bool  sort_ascending,
const bool  nulls_last,
Column< T > &  output 
)

Definition at line 101 of file OtherTestTableFunctions.cpp.

References Column< T >::ptr_, set_output_row_size(), Column< T >::size(), and gpu_enabled::sort().

105  {
106  const int64_t num_rows = input.size();
107  set_output_row_size(num_rows);
108  output = input;
109  if (sort_ascending) {
110  std::sort(output.ptr_, output.ptr_ + num_rows, SortAsc<T>(nulls_last));
111  } else {
112  std::sort(output.ptr_, output.ptr_ + num_rows, SortDesc<T>(nulls_last));
113  }
114  if (limit < 0 || limit > num_rows) {
115  return num_rows;
116  }
117  return limit;
118 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
DEVICE void sort(ARGS &&...args)
Definition: gpu_enabled.h:105

+ Here is the call graph for this function:

template NEVER_INLINE HOST int32_t sort_column_limit__cpu_template ( const Column< int8_t > &  input,
const int32_t  limit,
const bool  sort_ascending,
const bool  nulls_last,
Column< int8_t > &  output 
)
template NEVER_INLINE HOST int32_t sort_column_limit__cpu_template ( const Column< int16_t > &  input,
const int32_t  limit,
const bool  sort_ascending,
const bool  nulls_last,
Column< int16_t > &  output 
)
template NEVER_INLINE HOST int32_t sort_column_limit__cpu_template ( const Column< int32_t > &  input,
const int32_t  limit,
const bool  sort_ascending,
const bool  nulls_last,
Column< int32_t > &  output 
)
template NEVER_INLINE HOST int32_t sort_column_limit__cpu_template ( const Column< int64_t > &  input,
const int32_t  limit,
const bool  sort_ascending,
const bool  nulls_last,
Column< int64_t > &  output 
)
template NEVER_INLINE HOST int32_t sort_column_limit__cpu_template ( const Column< float > &  input,
const int32_t  limit,
const bool  sort_ascending,
const bool  nulls_last,
Column< float > &  output 
)
template NEVER_INLINE HOST int32_t sort_column_limit__cpu_template ( const Column< double > &  input,
const int32_t  limit,
const bool  sort_ascending,
const bool  nulls_last,
Column< double > &  output 
)
NEVER_INLINE HOST int32_t tf_metadata_getter__cpu_template ( TableFunctionManager mgr,
const Column< bool > &  input,
Column< bool > &  success 
)

Definition at line 897 of file OtherTestTableFunctions.cpp.

References f(), TableFunctionManager::get_metadata(), run_benchmark_import::result, and TableFunctionManager::set_output_row_size().

899  {
900  // get them all back and check values
901  int8_t i8{};
902  int16_t i16{};
903  int32_t i32{};
904  int64_t i64{};
905  float f{};
906  double d{};
907  bool b{};
908 
909  try {
910  mgr.get_metadata("test_int8_t", i8);
911  mgr.get_metadata("test_int16_t", i16);
912  mgr.get_metadata("test_int32_t", i32);
913  mgr.get_metadata("test_int64_t", i64);
914  mgr.get_metadata("test_float", f);
915  mgr.get_metadata("test_double", d);
916  mgr.get_metadata("test_bool", b);
917  } catch (const std::runtime_error& ex) {
918  return mgr.ERROR_MESSAGE(ex.what());
919  }
920 
921  // return value indicates values were correct
922  // types are implicitly correct by this point, or the above would have thrown
923  bool result = (i8 == 1) && (i16 == 2) && (i32 == 3) && (i64 == 4) && (f == 5.0f) &&
924  (d == 6.0) && b;
925  if (!result) {
926  return mgr.ERROR_MESSAGE("Metadata return values are incorrect");
927  }
928 
929  mgr.set_output_row_size(1);
930  success[0] = true;
931  return 1;
932 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
void get_metadata(const std::string &key, T &value)
Definition: heavydbTypes.h:397
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)

+ Here is the call graph for this function:

NEVER_INLINE HOST int32_t tf_metadata_getter_bad__cpu_template ( TableFunctionManager mgr,
const Column< bool > &  input,
Column< bool > &  success 
)

Definition at line 934 of file OtherTestTableFunctions.cpp.

References f(), TableFunctionManager::get_metadata(), and TableFunctionManager::set_output_row_size().

936  {
937  // get one back as the wrong type
938  // this should throw
939  float f{};
940  try {
941  mgr.get_metadata("test_double", f);
942  } catch (const std::runtime_error& ex) {
943  return mgr.ERROR_MESSAGE(ex.what());
944  }
945 
946  mgr.set_output_row_size(1);
947  success[0] = true;
948  return 1;
949 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
void get_metadata(const std::string &key, T &value)
Definition: heavydbTypes.h:397
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)

+ Here is the call graph for this function:

NEVER_INLINE HOST int32_t tf_metadata_setter__cpu_template ( TableFunctionManager mgr,
Column< bool > &  success 
)

Definition at line 857 of file OtherTestTableFunctions.cpp.

References f(), TableFunctionManager::set_metadata(), and TableFunctionManager::set_output_row_size().

858  {
859  // set one of each type
860  mgr.set_metadata("test_int8_t", int8_t(1));
861  mgr.set_metadata("test_int16_t", int16_t(2));
862  mgr.set_metadata("test_int32_t", int32_t(3));
863  mgr.set_metadata("test_int64_t", int64_t(4));
864  mgr.set_metadata("test_float", 5.0f);
865  mgr.set_metadata("test_double", 6.0);
866  mgr.set_metadata("test_bool", true);
867 
868  mgr.set_output_row_size(1);
869  success[0] = true;
870  return 1;
871 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)
void set_metadata(const std::string &key, const T &value)
Definition: heavydbTypes.h:388

+ Here is the call graph for this function:

NEVER_INLINE HOST int32_t tf_metadata_setter_repeated__cpu_template ( TableFunctionManager mgr,
Column< bool > &  success 
)

Definition at line 874 of file OtherTestTableFunctions.cpp.

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

875  {
876  // set the same name twice
877  mgr.set_metadata("test_int8_t", int8_t(1));
878  mgr.set_metadata("test_int8_t", int8_t(2));
879 
880  mgr.set_output_row_size(1);
881  success[0] = true;
882  return 1;
883 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
void set_metadata(const std::string &key, const T &value)
Definition: heavydbTypes.h:388

+ Here is the call graph for this function:

NEVER_INLINE HOST int32_t tf_metadata_setter_size_mismatch__cpu_template ( TableFunctionManager mgr,
Column< bool > &  success 
)

Definition at line 886 of file OtherTestTableFunctions.cpp.

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

887  {
888  // set the same name twice
889  mgr.set_metadata("test_int8_t", int8_t(1));
890  mgr.set_metadata("test_int8_t", int16_t(2));
891 
892  mgr.set_output_row_size(1);
893  success[0] = true;
894  return 1;
895 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
void set_metadata(const std::string &key, const T &value)
Definition: heavydbTypes.h:388

+ Here is the call graph for this function: