OmniSciDB  085a039ca4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TableFunctionsTesting.hpp File Reference
#include "../../QueryEngine/TableFunctions/SystemFunctions/os/Shared/TableFunctionsCommon.h"
#include "../../QueryEngine/heavydbTypes.h"
#include <algorithm>
#include <iostream>
#include <string>
+ Include dependency graph for TableFunctionsTesting.hpp:

Go to the source code of this file.

Classes

struct  SortAsc< T >
 
struct  SortDesc< T >
 

Macros

#define CPU_DEVICE_CODE   0x637075;
 
#define GPU_DEVICE_CODE   0x677075;
 

Enumerations

enum  TFAggType { MIN, MAX }
 

Functions

EXTENSION_NOINLINE int32_t ct_device_selection_udtf_any (const Column< int32_t > &input, Column< int64_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_device_selection_udtf_cpu__cpu_ (const Column< int32_t > &input, Column< int64_t > &out)
 
EXTENSION_NOINLINE int32_t ct_device_selection_udtf_gpu__gpu_ (const Column< int32_t > &input, Column< int64_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_device_selection_udtf_both__cpu_ (const Column< int32_t > &input, Column< int64_t > &out)
 
EXTENSION_NOINLINE int32_t ct_device_selection_udtf_both__gpu_ (const Column< int32_t > &input, Column< int64_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_1 (const Column< int32_t > &input1, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_2 (const Column< int32_t > &input1, const Column< int32_t > &input2, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_3 (const Column< int32_t > &input1, const Column< int32_t > &input2, const Column< int32_t > &input3, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_4 (const Column< int64_t > &input1, const Column< int32_t > &input2, const Column< int32_t > &input3, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_5 (const Column< int64_t > &input1, const Column< int64_t > &input2, const Column< int32_t > &input3, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_6 (const Column< int64_t > &input1, const Column< int32_t > &input2, const Column< int64_t > &input3, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_7 (const Column< int32_t > &input1, const ColumnList< int32_t > &input2, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_8 (const ColumnList< int32_t > &input1, const Column< int64_t > &input2, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_9 (const ColumnList< int32_t > &input1, const ColumnList< int64_t > &input2, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_10 (const Column< int64_t > &input1, const ColumnList< int64_t > &input2, const Column< int64_t > &input3, Column< int64_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_11 (const Column< int32_t > &input1, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_12 (const Column< int32_t > &input1, const Column< int32_t > &input2, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_13 (const Column< int32_t > &input1, const Column< int32_t > &input2, const Column< int32_t > &input3, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_14 (const Column< int64_t > &input1, const Column< int32_t > &input2, const Column< int32_t > &input3, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_15 (const Column< int64_t > &input1, const Column< int64_t > &input2, const Column< int32_t > &input3, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_16 (const Column< int64_t > &input1, const Column< int32_t > &input2, const Column< int64_t > &input3, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_17 (const Column< int32_t > &input1, const ColumnList< int32_t > &input2, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_18 (const ColumnList< int32_t > &input1, const Column< int64_t > &input2, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_19 (const ColumnList< int32_t > &input1, const ColumnList< int64_t > &input2, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_20 (const Column< int64_t > &input1, const ColumnList< int64_t > &input2, const Column< int64_t > &input3, const int32_t multiplier, Column< int64_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf2__cpu_21 (const int32_t multiplier, const Column< int32_t > &input1, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf6__cpu_22 (const Column< int32_t > &input1, const int32_t multiplier, const int32_t input2, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf4__cpu_23 (const ColumnList< int32_t > &input1, const int32_t multiplier, const int32_t input2, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf5__cpu_24 (const ColumnList< int32_t > &input1, const int32_t input2, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf3__cpu_25 (const Column< int32_t > &input1, const int32_t input2, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer1a__cpu_1 (const Column< int32_t > &input1, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer1b__cpu_2 (const Column< int32_t > &input1, const Column< int32_t > &input2, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer1c__cpu_3 (const Column< int32_t > &input1, const Column< int32_t > &input2, const Column< int32_t > &input3, const int32_t multiplier, const Column< int32_t > &input4, const int32_t x, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer1d__cpu_4 (const int32_t multiplier, const int32_t x, const Column< int32_t > &input1, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer2a__cpu_1 (const Column< int32_t > &input1, const int32_t x, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer2b__cpu_2 (const Column< int32_t > &input1, const int32_t multiplier, const Column< int32_t > &input2, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer2c__cpu_3 (const int32_t x, const int32_t multiplier, const Column< int32_t > &input1, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer3a__cpu_1 (const Column< int32_t > &input1, const int32_t multiplier, const int32_t x, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer3b__cpu_2 (const Column< int32_t > &input1, const int32_t x, const Column< int32_t > &input2, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer4a__cpu_1 (const Column< int32_t > &input1, const int32_t multiplier, const Column< int32_t > &input2, const int32_t x, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer4b__cpu_2 (const int32_t multiplier, const Column< int32_t > &input, const int32_t x, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_dict_encoded1__cpu_1 (const Column< TextEncodingDict > &input, const int32_t multiplier, Column< TextEncodingDict > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_dict_encoded2__cpu_1 (const Column< TextEncodingDict > &input1, const Column< TextEncodingDict > &input2, Column< TextEncodingDict > &out1, Column< TextEncodingDict > &out2)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_dict_encoded3__cpu_1 (const Column< TextEncodingDict > &input1, const Column< TextEncodingDict > &input2, Column< TextEncodingDict > &out1, Column< TextEncodingDict > &out2)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_dict_encoded4__cpu_1 (const ColumnList< TextEncodingDict > &input, Column< TextEncodingDict > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_dict_encoded5__cpu_1 (const ColumnList< TextEncodingDict > &input, Column< TextEncodingDict > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_dict_encoded6__cpu_1 (const ColumnList< TextEncodingDict > &input, Column< TextEncodingDict > &out0, Column< TextEncodingDict > &out1)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_binding_template__cpu_template (const Column< T > &input, Column< T > &out)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_binding_columnlist__cpu_template (const Column< T > &input1, const ColumnList< T > &input2, Column< int32_t > &out)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_binding_column__cpu_template (const Column< T > &input, Column< int32_t > &out)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_binding_scalar_multiply__cpu_template (const Column< T > &input, const T multiplier, Column< T > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_str_length__cpu_ (const Column< TextEncodingDict > &input_str, Column< TextEncodingDict > &out_str, Column< int64_t > &out_size)
 
EXTENSION_NOINLINE_HOST int32_t ct_binding_str_equals__cpu_ (const ColumnList< TextEncodingDict > &input_strings, Column< TextEncodingDict > &string_if_equal, Column< bool > &strings_are_equal)
 
EXTENSION_NOINLINE_HOST int32_t ct_substr__cpu_ (TableFunctionManager &mgr, const Column< TextEncodingDict > &input_str, const Column< int > &pos, const Column< int > &len, Column< TextEncodingDict > &output_substr)
 
EXTENSION_NOINLINE_HOST int32_t ct_string_concat__cpu_ (TableFunctionManager &mgr, const ColumnList< TextEncodingDict > &input_strings, const TextEncodingNone &separator, Column< TextEncodingDict > &concatted_string)
 
EXTENSION_NOINLINE_HOST int32_t ct_synthesize_new_dict__cpu_ (TableFunctionManager &mgr, const int64_t num_strings, Column< TextEncodingDict > &new_dict_col)
 
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<typename T , typename U , typename K >
NEVER_INLINE HOST int32_t ct_binding_column2__cpu_template (const Column< T > &input1, const Column< U > &input2, Column< K > &out)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_named_output__cpu_template (const Column< T > &input, Column< T > &out)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_named_const_output__cpu_template (const Column< T > &input, Column< T > &out)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_named_user_const_output__cpu_template (const Column< T > &input, int32_t c, Column< T > &out)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_named_rowmul_output__cpu_template (const Column< T > &input, int32_t m, Column< T > &out)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_no_arg_runtime_sizing__cpu_template (Column< T > &answer)
 
EXTENSION_NOINLINE int32_t ct_no_arg_constant_sizing (Column< int32_t > &answer)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_scalar_1_arg_runtime_sizing__cpu_template (const T num, Column< T > &answer)
 
EXTENSION_NOINLINE int32_t ct_scalar_2_args_constant_sizing (const int64_t num1, const int64_t num2, Column< int64_t > &answer1, Column< int64_t > &answer2)
 
EXTENSION_NOINLINE_HOST int32_t ct_no_cursor_user_constant_sizer__cpu_ (const int32_t input_num, int32_t c, Column< int32_t > &output)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_templated_no_cursor_user_constant_sizer__cpu_template (const T input_num, int32_t c, Column< T > &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)
 
EXTENSION_NOINLINE int32_t ct_gpu_default_init__gpu_ (Column< int32_t > &output_buffer)
 
EXTENSION_NOINLINE int32_t ct_hamming_distance (const TextEncodingNone &str1, const TextEncodingNone &str2, Column< int32_t > &hamming_distance)
 
template<typename T >
TEMPLATE_NOINLINE int32_t ct_get_string_chars__template (const Column< T > &indices, const TextEncodingNone &str, const int32_t multiplier, Column< int32_t > &idx, Column< int8_t > &char_bytes)
 
EXTENSION_NOINLINE_HOST int32_t ct_string_to_chars__cpu_ (const TextEncodingNone &input, Column< int32_t > &char_idx, Column< int8_t > &char_bytes)
 
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)
 
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)
 
template<typename T >
TEMPLATE_INLINEget_min_or_max (const Column< T > &col, const TFAggType min_or_max)
 
template<typename T >
TEMPLATE_INLINEget_min_or_max_union (const Column< T > &col1, const Column< T > &col2, const TFAggType min_or_max)
 
template<typename K , typename T , typename Z >
NEVER_INLINE HOST int32_t ct_pushdown_stats__cpu_template (TableFunctionManager &mgr, const TextEncodingNone &agg_type, const Column< K > &input_id, const Column< T > &input_x, const Column< T > &input_y, const Column< Z > &input_z, Column< int32_t > &output_row_count, Column< K > &output_id, Column< T > &output_x, Column< T > &output_y, Column< Z > &output_z)
 
template<typename K , typename T , typename Z >
NEVER_INLINE HOST int32_t ct_pushdown_projection__cpu_template (TableFunctionManager &mgr, const Column< K > &input_id, const Column< T > &input_x, const Column< T > &input_y, const Column< Z > &input_z, Column< K > &output_id, Column< T > &output_x, Column< T > &output_y, Column< Z > &output_z)
 
template<typename K , typename T , typename Z >
NEVER_INLINE HOST int32_t ct_union_pushdown_stats__cpu_template (TableFunctionManager &mgr, const TextEncodingNone &agg_type, const Column< K > &input1_id, const Column< T > &input1_x, const Column< T > &input1_y, const Column< Z > &input1_z, const Column< K > &input2_id, const Column< T > &input2_x, const Column< T > &input2_y, const Column< Z > &input2_z, const Column< T > &input2_w, Column< int32_t > &output_row_count, Column< K > &output_id, Column< T > &output_x, Column< T > &output_y, Column< Z > &output_z, Column< T > &output_w)
 
template<typename K , typename T , typename Z >
NEVER_INLINE HOST int32_t ct_union_pushdown_projection__cpu_template (TableFunctionManager &mgr, const Column< K > &input1_id, const Column< T > &input1_x, const Column< T > &input1_y, const Column< Z > &input1_z, const Column< K > &input2_id, const Column< T > &input2_x, const Column< T > &input2_y, const Column< Z > &input2_z, const Column< T > &input2_w, Column< K > &output_id, Column< T > &output_x, Column< T > &output_y, Column< Z > &output_z, Column< T > &output_w)
 
EXTENSION_NOINLINE_HOST int32_t ct_require__cpu_ (const Column< int32_t > &input1, const int32_t i, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_require_str__cpu_ (const Column< int32_t > &input1, const TextEncodingNone &s, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_require_mgr (TableFunctionManager &mgr, const Column< int32_t > &input1, const int32_t i, Column< int32_t > &out)
 
template<typename T , typename K >
NEVER_INLINE HOST int32_t ct_require_templating__cpu_template (const Column< T > &input1, const int32_t i, Column< K > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_require_and__cpu_ (const Column< int32_t > &input1, const int32_t i, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_require_or_str__cpu_ (const Column< int32_t > &input1, const TextEncodingNone &i, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_require_str_diff__cpu_ (const Column< int32_t > &input1, const TextEncodingNone &i, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_require_text_enc_dict__cpu_ (const Column< TextEncodingDict > &input, const int64_t x, Column< int64_t > &out)
 
EXTENSION_NOINLINE int32_t ct_test_nullable (const Column< int32_t > &input, const int32_t i, Column< int32_t > &out)
 
EXTENSION_NOINLINE int32_t ct_test_preflight_sizer (const Column< int32_t > &input, const int32_t i, const int32_t j, Column< int32_t > &out)
 
EXTENSION_NOINLINE int32_t ct_test_preflight_sizer_const (const Column< int32_t > &input, Column< int32_t > &out)
 
EXTENSION_NOINLINE int32_t ct_test_preflight_singlecursor_qe227__cpu_ (TableFunctionManager &mgr, const Column< int32_t > &col, const ColumnList< int32_t > &lst, const int x, const int y, Column< int32_t > &out)
 
EXTENSION_NOINLINE int32_t ct_test_preflight_multicursor_qe227__cpu_ (TableFunctionManager &mgr, const Column< int32_t > &col, const ColumnList< int32_t > &lst, const int x, const int y, Column< int32_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_scalar_named_args__cpu_ (TableFunctionManager &mgr, const int32_t arg1, const int32_t arg2, Column< int32_t > &out1, Column< int32_t > &out2)
 
EXTENSION_NOINLINE_HOST int32_t ct_cursor_named_args__cpu_ (TableFunctionManager &mgr, const Column< int32_t > &input_arg1, const Column< int32_t > &input_arg2, const int32_t arg1, const int32_t arg2, Column< int32_t > &out1, Column< int32_t > &out2)
 
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 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)
 

Macro Definition Documentation

#define CPU_DEVICE_CODE   0x637075;
#define GPU_DEVICE_CODE   0x677075;

Enumeration Type Documentation

enum TFAggType
Enumerator
MIN 
MAX 

Definition at line 1474 of file TableFunctionsTesting.hpp.

Function Documentation

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 1119 of file TableFunctionsTesting.hpp.

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

1119  {
1120  int32_t output_num_rows = input.numCols();
1121  set_output_row_size(output_num_rows);
1122  for (int i = 0; i < output_num_rows; i++) {
1123  auto col = input[i];
1124  T s = 0;
1125  for (int j = 0; j < col.size(); j++) {
1126  try {
1127  s = safe_addition(s, col[j]);
1128  } catch (const std::exception& e) {
1129  return TABLE_FUNCTION_ERROR(e.what());
1130  } catch (...) {
1131  return TABLE_FUNCTION_ERROR("Unknown error");
1132  }
1133  }
1134  out[i] = s;
1135  }
1136  return output_num_rows;
1137 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t numCols() const
Definition: heavydbTypes.h:567
T safe_addition(T x, T y)
#define TABLE_FUNCTION_ERROR(MSG)
Definition: heavydbTypes.h:63

+ Here is the call graph for this function:

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 1403 of file TableFunctionsTesting.hpp.

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

1408  {
1409  auto size = input1.size();
1410  mgr.set_output_row_size(size);
1411  for (int32_t i = 0; i < size; i++) {
1412  output1[i] = input1[i] + size;
1413  output2[i] = input2[i] * alpha;
1414  }
1415  return size;
1416 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ Here is the call graph for this function:

template<typename T , typename U , typename K >
NEVER_INLINE HOST int32_t ct_binding_column2__cpu_template ( const Column< T > &  input1,
const Column< U > &  input2,
Column< K > &  out 
)

Definition at line 828 of file TableFunctionsTesting.hpp.

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

830  {
831  if constexpr (std::is_same<T, TextEncodingDict>::value &&
832  std::is_same<U, TextEncodingDict>::value) {
833  set_output_row_size(input1.size());
834  for (int64_t i = 0; i < input1.size(); i++) {
835  out[i] = input1[i];
836  }
837  return input1.size();
838  }
839 
841  if constexpr (std::is_same<T, int32_t>::value && std::is_same<U, double>::value) {
842  out[0] = 10;
843  } else if constexpr (std::is_same<T, double>::value && std::is_same<U, double>::value) {
844  out[0] = 20;
845  } else if constexpr (std::is_same<T, int32_t>::value &&
846  std::is_same<U, int32_t>::value) {
847  out[0] = 30;
848  } else if constexpr (std::is_same<T, double>::value &&
849  std::is_same<U, int32_t>::value) {
850  out[0] = 40;
851  }
852  return 1;
853 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ Here is the call graph for this function:

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

Definition at line 581 of file TableFunctionsTesting.hpp.

References set_output_row_size().

582  {
584  if constexpr (std::is_same<T, int32_t>::value) {
585  out[0] = 10;
586  } else {
587  out[0] = 20;
588  }
589  return 1;
590 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)

+ Here is the call graph for this function:

template<typename T >
NEVER_INLINE HOST int32_t ct_binding_columnlist__cpu_template ( const Column< T > &  input1,
const ColumnList< T > &  input2,
Column< int32_t > &  out 
)

Definition at line 553 of file TableFunctionsTesting.hpp.

References set_output_row_size().

555  {
557  if constexpr (std::is_same<T, int32_t>::value) {
558  out[0] = 1;
559  } else if constexpr (std::is_same<T, float>::value) {
560  out[0] = 2;
561  } else if constexpr (std::is_same<T, TextEncodingDict>::value) {
562  out[0] = 3;
563  } else {
564  out[0] = 4;
565  }
566  return 1;
567 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_binding_dict_encoded1__cpu_1 ( const Column< TextEncodingDict > &  input,
const int32_t  multiplier,
Column< TextEncodingDict > &  out 
)

Definition at line 447 of file TableFunctionsTesting.hpp.

References Column< TextEncodingDict >::size().

449  {
450  for (int64_t i = 0; i < input.size(); i++) {
451  out[i] = input[i]; // assign string id
452  }
453  return multiplier * input.size();
454 }
DEVICE int64_t size() const
Definition: heavydbTypes.h:498

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_binding_dict_encoded2__cpu_1 ( const Column< TextEncodingDict > &  input1,
const Column< TextEncodingDict > &  input2,
Column< TextEncodingDict > &  out1,
Column< TextEncodingDict > &  out2 
)

Definition at line 457 of file TableFunctionsTesting.hpp.

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

460  {
461  set_output_row_size(input1.size());
462  for (int64_t i = 0; i < input1.size(); i++) {
463  out1[i] = input1[i];
464  out2[i] = input2[i];
465  }
466  return input1.size();
467 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
Definition: heavydbTypes.h:498

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_binding_dict_encoded3__cpu_1 ( const Column< TextEncodingDict > &  input1,
const Column< TextEncodingDict > &  input2,
Column< TextEncodingDict > &  out1,
Column< TextEncodingDict > &  out2 
)

Definition at line 470 of file TableFunctionsTesting.hpp.

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

473  {
474  set_output_row_size(input1.size());
475  for (int64_t i = 0; i < input1.size(); i++) {
476  out1[i] = input2[i];
477  out2[i] = input1[i];
478  }
479  return input1.size();
480 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
Definition: heavydbTypes.h:498

+ Here is the call graph for this function:

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

Definition at line 483 of file TableFunctionsTesting.hpp.

References set_output_row_size(), and ColumnList< TextEncodingDict >::size().

484  {
485  int64_t sz = input[0].size();
487  for (int64_t i = 0; i < sz; i++) {
488  out[i] = input[0][i];
489  }
490  return sz;
491 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
Definition: heavydbTypes.h:602

+ Here is the call graph for this function:

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

Definition at line 494 of file TableFunctionsTesting.hpp.

References set_output_row_size(), and ColumnList< TextEncodingDict >::size().

495  {
496  int64_t sz = input[1].size();
498  for (int64_t i = 0; i < sz; i++) {
499  out[i] = input[1][i];
500  }
501  return sz;
502 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
Definition: heavydbTypes.h:602

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_binding_dict_encoded6__cpu_1 ( const ColumnList< TextEncodingDict > &  input,
Column< TextEncodingDict > &  out0,
Column< TextEncodingDict > &  out1 
)

Definition at line 505 of file TableFunctionsTesting.hpp.

References set_output_row_size(), and ColumnList< TextEncodingDict >::size().

507  {
508  int64_t sz = input[0].size();
510  for (int64_t i = 0; i < sz; i++) {
511  out0[i] = input[0][i];
512  out1[i] = input[1][i];
513  }
514  return sz;
515 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
Definition: heavydbTypes.h:602

+ 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 606 of file TableFunctionsTesting.hpp.

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

608  {
609  const int64_t num_rows = input.size();
610  set_output_row_size(num_rows);
611  for (int64_t r = 0; r < num_rows; ++r) {
612  if (!input.isNull(r)) {
613  out[r] = input[r] * multiplier;
614  } else {
615  out.setNull(r);
616  }
617  }
618  return num_rows;
619 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
DEVICE bool isNull(int64_t index) const
Definition: heavydbTypes.h:447
DEVICE void setNull(int64_t index)
Definition: heavydbTypes.h:448

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_binding_str_equals__cpu_ ( const ColumnList< TextEncodingDict > &  input_strings,
Column< TextEncodingDict > &  string_if_equal,
Column< bool > &  strings_are_equal 
)

Definition at line 646 of file TableFunctionsTesting.hpp.

References ColumnList< TextEncodingDict >::numCols(), set_output_row_size(), Column< TextEncodingDict >::setNull(), and ColumnList< TextEncodingDict >::size().

648  {
649  const int64_t num_rows = input_strings.size();
650  const int64_t num_cols = input_strings.numCols();
651  set_output_row_size(num_rows);
652  for (int64_t r = 0; r < num_rows; r++) {
653  bool are_equal = true;
654  if (num_cols > 0) {
655  std::string first_str = input_strings[0].getString(r);
656  for (int64_t c = 1; c != num_cols; ++c) {
657  if (input_strings[c].getString(r) != first_str) {
658  are_equal = false;
659  break;
660  }
661  }
662  strings_are_equal[r] = are_equal;
663  if (are_equal && num_cols > 0) {
664  string_if_equal[r] = input_strings[0][r];
665  } else {
666  string_if_equal.setNull(r);
667  }
668  }
669  }
670  return num_rows;
671 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
Definition: heavydbTypes.h:602
DEVICE void setNull(int64_t index)
Definition: heavydbTypes.h:502
DEVICE int64_t numCols() const
Definition: heavydbTypes.h:603

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_binding_str_length__cpu_ ( const Column< TextEncodingDict > &  input_str,
Column< TextEncodingDict > &  out_str,
Column< int64_t > &  out_size 
)

Definition at line 627 of file TableFunctionsTesting.hpp.

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

629  {
630  const int64_t num_rows = input_str.size();
631  set_output_row_size(num_rows);
632  for (int64_t i = 0; i < num_rows; i++) {
633  out_str[i] = input_str[i];
634  const std::string str = input_str.getString(i);
635  out_size[i] = str.size();
636  }
637  return num_rows;
638 }
DEVICE const std::string getString(int64_t index) const
Definition: heavydbTypes.h:506
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
DEVICE int64_t size() const
Definition: heavydbTypes.h:498

+ Here is the call graph for this function:

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

Definition at line 530 of file TableFunctionsTesting.hpp.

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

531  {
532  set_output_row_size(input.size());
533  for (int64_t i = 0; i < input.size(); i++) {
534  out[i] = input[i];
535  }
536  return input.size();
537 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf2__cpu_21 ( const int32_t  multiplier,
const Column< int32_t > &  input1,
Column< int32_t > &  out 
)

Definition at line 277 of file TableFunctionsTesting.hpp.

279  {
280  out[0] = 1000 + 91 + multiplier;
281  return 1;
282 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf3__cpu_25 ( const Column< int32_t > &  input1,
const int32_t  input2,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 306 of file TableFunctionsTesting.hpp.

309  {
310  out[0] = 1000 + 169 + multiplier + 10 * input2;
311  return 1;
312 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf4__cpu_23 ( const ColumnList< int32_t > &  input1,
const int32_t  multiplier,
const int32_t  input2,
Column< int32_t > &  out 
)

Definition at line 291 of file TableFunctionsTesting.hpp.

294  {
295  out[0] = 1000 + 396 + multiplier + 10 * input2;
296  return 1;
297 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf5__cpu_24 ( const ColumnList< int32_t > &  input1,
const int32_t  input2,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 299 of file TableFunctionsTesting.hpp.

302  {
303  out[0] = 1000 + 369 + multiplier + 10 * input2;
304  return 1;
305 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf6__cpu_22 ( const Column< int32_t > &  input1,
const int32_t  multiplier,
const int32_t  input2,
Column< int32_t > &  out 
)

Definition at line 283 of file TableFunctionsTesting.hpp.

286  {
287  out[0] = 1000 + 196 + multiplier + 10 * input2;
288  return 1;
289 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_11 ( const Column< int32_t > &  input1,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 202 of file TableFunctionsTesting.hpp.

204  {
205  out[0] = 1000 + 19 + multiplier;
206  return 1;
207 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_12 ( const Column< int32_t > &  input1,
const Column< int32_t > &  input2,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 208 of file TableFunctionsTesting.hpp.

211  {
212  out[0] = 1000 + 119 + multiplier;
213  return 1;
214 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_13 ( const Column< int32_t > &  input1,
const Column< int32_t > &  input2,
const Column< int32_t > &  input3,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 215 of file TableFunctionsTesting.hpp.

219  {
220  out[0] = 1000 + 1119 + multiplier;
221  return 1;
222 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_14 ( const Column< int64_t > &  input1,
const Column< int32_t > &  input2,
const Column< int32_t > &  input3,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 223 of file TableFunctionsTesting.hpp.

227  {
228  out[0] = 1000 + 2119 + multiplier;
229  return 1;
230 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_15 ( const Column< int64_t > &  input1,
const Column< int64_t > &  input2,
const Column< int32_t > &  input3,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 231 of file TableFunctionsTesting.hpp.

235  {
236  out[0] = 1000 + 2219 + multiplier;
237  return 1;
238 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_16 ( const Column< int64_t > &  input1,
const Column< int32_t > &  input2,
const Column< int64_t > &  input3,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 239 of file TableFunctionsTesting.hpp.

243  {
244  out[0] = 1000 + 2129 + multiplier;
245  return 1;
246 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_17 ( const Column< int32_t > &  input1,
const ColumnList< int32_t > &  input2,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 247 of file TableFunctionsTesting.hpp.

250  {
251  out[0] = 1000 + 139 + multiplier;
252  return 1;
253 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_18 ( const ColumnList< int32_t > &  input1,
const Column< int64_t > &  input2,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 254 of file TableFunctionsTesting.hpp.

257  {
258  out[0] = 1000 + 329 + multiplier;
259  return 1;
260 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_19 ( const ColumnList< int32_t > &  input1,
const ColumnList< int64_t > &  input2,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 261 of file TableFunctionsTesting.hpp.

264  {
265  out[0] = 1000 + 349 + multiplier;
266  return 1;
267 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf__cpu_20 ( const Column< int64_t > &  input1,
const ColumnList< int64_t > &  input2,
const Column< int64_t > &  input3,
const int32_t  multiplier,
Column< int64_t > &  out 
)

Definition at line 268 of file TableFunctionsTesting.hpp.

272  {
273  out[0] = 1000 + 2429 + multiplier;
274  return 1;
275 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_1 ( const Column< int32_t > &  input1,
Column< int32_t > &  out 
)

Definition at line 129 of file TableFunctionsTesting.hpp.

129  {
130  out[0] = 1;
131  return 1;
132 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_10 ( const Column< int64_t > &  input1,
const ColumnList< int64_t > &  input2,
const Column< int64_t > &  input3,
Column< int64_t > &  out 
)

Definition at line 194 of file TableFunctionsTesting.hpp.

197  {
198  out[0] = 242;
199  return 1;
200 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_2 ( const Column< int32_t > &  input1,
const Column< int32_t > &  input2,
Column< int32_t > &  out 
)

Definition at line 134 of file TableFunctionsTesting.hpp.

136  {
137  out[0] = 11;
138  return 1;
139 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_3 ( const Column< int32_t > &  input1,
const Column< int32_t > &  input2,
const Column< int32_t > &  input3,
Column< int32_t > &  out 
)

Definition at line 141 of file TableFunctionsTesting.hpp.

144  {
145  out[0] = 111;
146  return 1;
147 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_4 ( const Column< int64_t > &  input1,
const Column< int32_t > &  input2,
const Column< int32_t > &  input3,
Column< int32_t > &  out 
)

Definition at line 149 of file TableFunctionsTesting.hpp.

152  {
153  out[0] = 211;
154  return 1;
155 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_5 ( const Column< int64_t > &  input1,
const Column< int64_t > &  input2,
const Column< int32_t > &  input3,
Column< int32_t > &  out 
)

Definition at line 157 of file TableFunctionsTesting.hpp.

160  {
161  out[0] = 221;
162  return 1;
163 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_6 ( const Column< int64_t > &  input1,
const Column< int32_t > &  input2,
const Column< int64_t > &  input3,
Column< int32_t > &  out 
)

Definition at line 165 of file TableFunctionsTesting.hpp.

168  {
169  out[0] = 212;
170  return 1;
171 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_7 ( const Column< int32_t > &  input1,
const ColumnList< int32_t > &  input2,
Column< int32_t > &  out 
)

Definition at line 173 of file TableFunctionsTesting.hpp.

175  {
176  out[0] = 13;
177  return 1;
178 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_8 ( const ColumnList< int32_t > &  input1,
const Column< int64_t > &  input2,
Column< int32_t > &  out 
)

Definition at line 180 of file TableFunctionsTesting.hpp.

182  {
183  out[0] = 32;
184  return 1;
185 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_9 ( const ColumnList< int32_t > &  input1,
const ColumnList< int64_t > &  input2,
Column< int32_t > &  out 
)

Definition at line 187 of file TableFunctionsTesting.hpp.

189  {
190  out[0] = 34;
191  return 1;
192 }
EXTENSION_NOINLINE_HOST int32_t ct_copy_and_add_size ( TableFunctionManager mgr,
const Column< int32_t > &  input,
Column< int32_t > &  output 
)

Definition at line 1393 of file TableFunctionsTesting.hpp.

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

1395  {
1396  mgr.set_output_row_size(input.size());
1397  for (int32_t i = 0; i < input.size(); i++) {
1398  output[i] = input[i] + input.size();
1399  }
1400  return output.size();
1401 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_cursor_named_args__cpu_ ( TableFunctionManager mgr,
const Column< int32_t > &  input_arg1,
const Column< int32_t > &  input_arg2,
const int32_t  arg1,
const int32_t  arg2,
Column< int32_t > &  out1,
Column< int32_t > &  out2 
)

Definition at line 1898 of file TableFunctionsTesting.hpp.

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

1900  {
1901  const int32_t num_rows = input_arg1.size();
1902  mgr.set_output_row_size(num_rows);
1903  for (int32_t r = 0; r < num_rows; ++r) {
1904  out1[r] = input_arg1[r] + arg1;
1905  out2[r] = input_arg2[r] + arg2;
1906  }
1907  return num_rows;
1908 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_device_selection_udtf_any ( const Column< int32_t > &  input,
Column< int64_t > &  out 
)

Definition at line 41 of file TableFunctionsTesting.hpp.

References CPU_DEVICE_CODE, and GPU_DEVICE_CODE.

41  {
42 #ifdef __CUDACC__
43  out[0] = GPU_DEVICE_CODE;
44 #else
45  out[0] = CPU_DEVICE_CODE;
46 #endif
47  return 1;
48 }
#define CPU_DEVICE_CODE
#define GPU_DEVICE_CODE
EXTENSION_NOINLINE_HOST int32_t ct_device_selection_udtf_both__cpu_ ( const Column< int32_t > &  input,
Column< int64_t > &  out 
)

Definition at line 71 of file TableFunctionsTesting.hpp.

References CPU_DEVICE_CODE.

72  {
73  out[0] = CPU_DEVICE_CODE;
74  return 1;
75 }
#define CPU_DEVICE_CODE
EXTENSION_NOINLINE int32_t ct_device_selection_udtf_both__gpu_ ( const Column< int32_t > &  input,
Column< int64_t > &  out 
)

Definition at line 80 of file TableFunctionsTesting.hpp.

References GPU_DEVICE_CODE.

81  {
82  out[0] = GPU_DEVICE_CODE;
83  return 1;
84 }
#define GPU_DEVICE_CODE
EXTENSION_NOINLINE_HOST int32_t ct_device_selection_udtf_cpu__cpu_ ( const Column< int32_t > &  input,
Column< int64_t > &  out 
)

Definition at line 53 of file TableFunctionsTesting.hpp.

References CPU_DEVICE_CODE.

54  {
55  out[0] = CPU_DEVICE_CODE;
56  return 1;
57 }
#define CPU_DEVICE_CODE
EXTENSION_NOINLINE int32_t ct_device_selection_udtf_gpu__gpu_ ( const Column< int32_t > &  input,
Column< int64_t > &  out 
)

Definition at line 62 of file TableFunctionsTesting.hpp.

References GPU_DEVICE_CODE.

63  {
64  out[0] = GPU_DEVICE_CODE;
65  return 1;
66 }
#define GPU_DEVICE_CODE
template<typename T >
TEMPLATE_NOINLINE int32_t ct_get_string_chars__template ( const Column< T > &  indices,
const TextEncodingNone str,
const int32_t  multiplier,
Column< int32_t > &  idx,
Column< int8_t > &  char_bytes 
)

Definition at line 1190 of file TableFunctionsTesting.hpp.

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

1194  {
1195  const int32_t str_len = str.size();
1196  // Note: we assume RowMultiplier is 1 for this test, was to make running on
1197  // GPU easy Todo: Provide Constant RowMultiplier interface
1198  if (multiplier != 1) {
1199  return 0;
1200  }
1201  const int32_t num_input_rows = indices.size();
1202  const int32_t num_output_rows = num_input_rows * multiplier;
1203 
1204 #ifdef __CUDACC__
1205  const int32_t start = threadIdx.x + blockDim.x * blockIdx.x;
1206  const int32_t step = blockDim.x * gridDim.x;
1207 #else
1208  const int32_t start = 0;
1209  const int32_t step = 1;
1210 #endif
1211 
1212  for (int32_t i = start; i < num_output_rows; i += step) {
1213  idx[i] = indices[i % num_output_rows];
1214  char_bytes[i] = str[i % str_len]; // index < str_len ? str[i] : 0;
1215  }
1216  return num_output_rows;
1217 }
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
DEVICE ALWAYS_INLINE int64_t size() const
Definition: heavydbTypes.h:184

+ 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 1147 of file TableFunctionsTesting.hpp.

1147  {
1148  // output_buffer[0] should always be 0 due to default initialization for GPU
1149  return 1;
1150 }
EXTENSION_NOINLINE int32_t ct_hamming_distance ( const TextEncodingNone str1,
const TextEncodingNone str2,
Column< int32_t > &  hamming_distance 
)

Definition at line 1158 of file TableFunctionsTesting.hpp.

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

1160  {
1161  const int32_t str_len = str1.size() <= str2.size() ? str1.size() : str2.size();
1162 
1163 #ifdef __CUDACC__
1164  const int32_t start = threadIdx.x + blockDim.x * blockIdx.x;
1165  const int32_t step = blockDim.x * gridDim.x;
1166  int32_t* output_ptr = hamming_distance.ptr_;
1167 #else
1168  const int32_t start = 0;
1169  const int32_t step = 1;
1170 #endif
1171 
1172  int32_t num_chars_unequal = 0;
1173  for (int32_t i = start; i < str_len; i += step) {
1174  num_chars_unequal += (str1[i] != str2[i]) ? 1 : 0;
1175  }
1176 #ifdef __CUDACC__
1177  atomicAdd(output_ptr, num_chars_unequal);
1178 #else
1179  hamming_distance[0] = num_chars_unequal;
1180 #endif
1181  return 1;
1182 }
T * ptr_
Definition: heavydbTypes.h:430
DEVICE ALWAYS_INLINE int64_t size() const
Definition: heavydbTypes.h:184

+ Here is the call graph for this function:

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

Definition at line 881 of file TableFunctionsTesting.hpp.

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

882  {
883  T acc1 = 0, acc2 = 0;
884  for (int64_t i = 0; i < input.size(); i++) {
885  if (i % 2 == 0) {
886  acc1 += input[i];
887  } else {
888  acc2 += input[i];
889  }
890  }
891  out[0] = acc1;
892  out[1] = acc2;
893  return 2;
894 }
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ Here is the call graph for this function:

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

Definition at line 869 of file TableFunctionsTesting.hpp.

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

870  {
872  T acc = 0;
873  for (int64_t i = 0; i < input.size(); i++) {
874  acc += input[i];
875  }
876  out[0] = acc;
877  return 1;
878 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ Here is the call graph for this function:

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

Definition at line 910 of file TableFunctionsTesting.hpp.

References Column< T >::size().

912  {
913  for (int64_t j = 0; j < m; j++) {
914  for (int64_t i = 0; i < input.size(); i++) {
915  out[j * input.size() + i] += input[i];
916  }
917  }
918  return m * input.size();
919 }
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ Here is the call graph for this function:

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

Definition at line 897 of file TableFunctionsTesting.hpp.

References Column< T >::size().

899  {
900  for (int64_t i = 0; i < c; i++) {
901  out[i] = 0;
902  }
903  for (int64_t i = 0; i < input.size(); i++) {
904  out[i % c] += input[i];
905  }
906  return c;
907 }
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_no_arg_constant_sizing ( Column< int32_t > &  answer)

Definition at line 946 of file TableFunctionsTesting.hpp.

946  {
947 #ifdef __CUDACC__
948  int32_t start = threadIdx.x + blockDim.x * blockIdx.x;
949  int32_t stop = static_cast<int32_t>(42);
950  int32_t step = blockDim.x * gridDim.x;
951 #else
952  auto start = 0;
953  auto stop = 42;
954  auto step = 1;
955 #endif
956  for (auto i = start; i < stop; i += step) {
957  answer[i] = 42 * i;
958  }
959  return 42;
960 }
template<typename T >
NEVER_INLINE HOST int32_t ct_no_arg_runtime_sizing__cpu_template ( Column< T > &  answer)

Definition at line 932 of file TableFunctionsTesting.hpp.

References set_output_row_size().

932  {
934  answer[0] = 42;
935  return 1;
936 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_no_cursor_user_constant_sizer__cpu_ ( const int32_t  input_num,
int32_t  c,
Column< int32_t > &  output 
)

Definition at line 1020 of file TableFunctionsTesting.hpp.

1022  {
1023  for (int32_t i = 0; i < c; i++) {
1024  output[i] = input_num;
1025  }
1026  return c;
1027 }
template<typename K , typename T , typename Z >
NEVER_INLINE HOST int32_t ct_pushdown_projection__cpu_template ( TableFunctionManager mgr,
const Column< K > &  input_id,
const Column< T > &  input_x,
const Column< T > &  input_y,
const Column< Z > &  input_z,
Column< K > &  output_id,
Column< T > &  output_x,
Column< T > &  output_y,
Column< Z > &  output_z 
)

Definition at line 1542 of file TableFunctionsTesting.hpp.

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

1550  {
1551  const int64_t input_size = input_id.size();
1552  mgr.set_output_row_size(input_size);
1553  for (int64_t input_idx = 0; input_idx < input_size; ++input_idx) {
1554  output_id[input_idx] = input_id[input_idx];
1555  output_x[input_idx] = input_x[input_idx];
1556  output_y[input_idx] = input_y[input_idx];
1557  output_z[input_idx] = input_z[input_idx];
1558  }
1559  return input_size;
1560 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ Here is the call graph for this function:

template<typename K , typename T , typename Z >
NEVER_INLINE HOST int32_t ct_pushdown_stats__cpu_template ( TableFunctionManager mgr,
const TextEncodingNone agg_type,
const Column< K > &  input_id,
const Column< T > &  input_x,
const Column< T > &  input_y,
const Column< Z > &  input_z,
Column< int32_t > &  output_row_count,
Column< K > &  output_id,
Column< T > &  output_x,
Column< T > &  output_y,
Column< Z > &  output_z 
)

Definition at line 1509 of file TableFunctionsTesting.hpp.

References get_min_or_max(), TextEncodingNone::getString(), MAX, MIN, TableFunctionManager::set_output_row_size(), and Column< T >::size().

1519  {
1520  const std::string agg_type_str = agg_type.getString();
1521  const TFAggType min_or_max = agg_type_str == "MIN" ? TFAggType::MIN : TFAggType::MAX;
1522  mgr.set_output_row_size(1);
1523  output_row_count[0] = input_id.size();
1524  output_id[0] = get_min_or_max(input_id, min_or_max);
1525  output_x[0] = get_min_or_max(input_x, min_or_max);
1526  output_y[0] = get_min_or_max(input_y, min_or_max);
1527  output_z[0] = get_min_or_max(input_z, min_or_max);
1528  return 1;
1529 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
std::string getString() const
Definition: heavydbTypes.h:162
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
TEMPLATE_INLINE T get_min_or_max(const Column< T > &col, const TFAggType min_or_max)

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_require__cpu_ ( const Column< int32_t > &  input1,
const int32_t  i,
Column< int32_t > &  out 
)

Definition at line 1673 of file TableFunctionsTesting.hpp.

References set_output_row_size().

1675  {
1677  out[0] = 3;
1678  return 1;
1679 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_require_and__cpu_ ( const Column< int32_t > &  input1,
const int32_t  i,
Column< int32_t > &  out 
)

Definition at line 1711 of file TableFunctionsTesting.hpp.

References set_output_row_size().

1713  {
1715  out[0] = 7;
1716  return 1;
1717 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_require_mgr ( TableFunctionManager mgr,
const Column< int32_t > &  input1,
const int32_t  i,
Column< int32_t > &  out 
)

Definition at line 1689 of file TableFunctionsTesting.hpp.

References set_output_row_size().

1692  {
1694  out[0] = 4;
1695  return 1;
1696 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_require_or_str__cpu_ ( const Column< int32_t > &  input1,
const TextEncodingNone i,
Column< int32_t > &  out 
)

Definition at line 1719 of file TableFunctionsTesting.hpp.

References set_output_row_size().

1721  {
1723  out[0] = 8;
1724  return 1;
1725 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_require_str__cpu_ ( const Column< int32_t > &  input1,
const TextEncodingNone s,
Column< int32_t > &  out 
)

Definition at line 1681 of file TableFunctionsTesting.hpp.

References set_output_row_size().

1683  {
1685  out[0] = 3;
1686  return 1;
1687 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_require_str_diff__cpu_ ( const Column< int32_t > &  input1,
const TextEncodingNone i,
Column< int32_t > &  out 
)

Definition at line 1727 of file TableFunctionsTesting.hpp.

References set_output_row_size().

1729  {
1731  out[0] = 9;
1732  return 1;
1733 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)

+ Here is the call graph for this function:

template<typename T , typename K >
NEVER_INLINE HOST int32_t ct_require_templating__cpu_template ( const Column< T > &  input1,
const int32_t  i,
Column< K > &  out 
)

Definition at line 1699 of file TableFunctionsTesting.hpp.

References set_output_row_size().

1701  {
1703  if constexpr (std::is_same<T, int32_t>::value) {
1704  out[0] = 5;
1705  } else if constexpr (std::is_same<T, double>::value) {
1706  out[0] = 6.0;
1707  }
1708  return 1;
1709 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_require_text_enc_dict__cpu_ ( const Column< TextEncodingDict > &  input,
const int64_t  x,
Column< int64_t > &  out 
)

Definition at line 1736 of file TableFunctionsTesting.hpp.

References set_output_row_size().

1738  {
1740  out[0] = 10;
1741  return 1;
1742 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)

+ Here is the call graph for this function:

template<typename T >
NEVER_INLINE HOST int32_t ct_scalar_1_arg_runtime_sizing__cpu_template ( const T  num,
Column< T > &  answer 
)

Definition at line 972 of file TableFunctionsTesting.hpp.

References set_output_row_size(), and heavydb.dtypes::T.

972  {
973  T quotient = num;
975  int32_t counter{0};
976  while (quotient >= 1) {
977  answer[counter++] = quotient;
978  quotient /= 10;
979  }
980  return counter;
981 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_scalar_2_args_constant_sizing ( const int64_t  num1,
const int64_t  num2,
Column< int64_t > &  answer1,
Column< int64_t > &  answer2 
)

Definition at line 991 of file TableFunctionsTesting.hpp.

994  {
995 #ifdef __CUDACC__
996  int32_t start = threadIdx.x + blockDim.x * blockIdx.x;
997  int32_t stop = static_cast<int32_t>(5);
998  int32_t step = blockDim.x * gridDim.x;
999 #else
1000  auto start = 0;
1001  auto stop = 5;
1002  auto step = 1;
1003 #endif
1004  for (auto i = start; i < stop; i += step) {
1005  answer1[i] = num1 + i * num2;
1006  answer2[i] = num1 - i * num2;
1007  }
1008  return 5;
1009 }
EXTENSION_NOINLINE_HOST int32_t ct_scalar_named_args__cpu_ ( TableFunctionManager mgr,
const int32_t  arg1,
const int32_t  arg2,
Column< int32_t > &  out1,
Column< int32_t > &  out2 
)

Definition at line 1882 of file TableFunctionsTesting.hpp.

References TableFunctionManager::set_output_row_size().

1883  {
1884  mgr.set_output_row_size(1);
1885  out1[0] = arg1;
1886  out2[0] = arg2;
1887  return 1;
1888  }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_sleep1__cpu_ ( int32_t  seconds,
int32_t  mode,
Column< int32_t > &  output 
)

Definition at line 1293 of file TableFunctionsTesting.hpp.

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

1295  {
1296  switch (mode) {
1297  case 0: {
1298  set_output_row_size(3); // uses global singleton of TableFunctionManager
1299  break;
1300  }
1301  case 1: {
1303  mgr->set_output_row_size(3);
1304  break;
1305  }
1306  case 2:
1307  case 3: {
1308  break;
1309  }
1310  default:
1311  return TABLE_FUNCTION_ERROR("unexpected mode");
1312  }
1313  if (output.size() == 0) {
1314  return TABLE_FUNCTION_ERROR("unspecified output columns row size");
1315  }
1316  return ct_sleep_worker(seconds, output);
1317 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
EXTENSION_NOINLINE int32_t ct_sleep_worker(int32_t seconds, Column< int32_t > &output)
#define TABLE_FUNCTION_ERROR(MSG)
Definition: heavydbTypes.h:63
static TableFunctionManager * get_singleton()
Definition: heavydbTypes.h:651

+ 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 1319 of file TableFunctionsTesting.hpp.

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

1322  {
1323  switch (mode) {
1324  case 0:
1325  case 1: {
1326  mgr.set_output_row_size(3); // uses thread-safe TableFunctionManager instance
1327  break;
1328  }
1329  case 2: {
1330  break;
1331  }
1332  case 3: {
1333  try {
1334  auto* mgr0 = TableFunctionManager::get_singleton(); // it may throw "singleton is
1335  // not initialized"
1336  mgr0->set_output_row_size(3);
1337  } catch (std::exception& e) {
1338  return mgr.ERROR_MESSAGE(e.what());
1339  }
1340  break;
1341  }
1342  default:
1343  return mgr.ERROR_MESSAGE("unexpected mode");
1344  }
1345  if (output.size() == 0) {
1346  return mgr.ERROR_MESSAGE("unspecified output columns row size");
1347  }
1348  return ct_sleep_worker(seconds, output);
1349 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
EXTENSION_NOINLINE int32_t ct_sleep_worker(int32_t seconds, Column< int32_t > &output)
static TableFunctionManager * get_singleton()
Definition: heavydbTypes.h:651

+ 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 1275 of file TableFunctionsTesting.hpp.

Referenced by ct_sleep1__cpu_(), and ct_sleep2().

1275  {
1276  // save entering time
1277  output[0] = std::chrono::duration_cast<std::chrono::milliseconds>(
1278  std::chrono::system_clock::now().time_since_epoch())
1279  .count() &
1280  0xffffff;
1281  // store thread id info
1282  output[2] = std::hash<std::thread::id>()(std::this_thread::get_id()) & 0xffff;
1283  // do "computations" for given seconds
1284  std::this_thread::sleep_for(std::chrono::seconds(seconds));
1285  // save leaving time
1286  output[1] = std::chrono::duration_cast<std::chrono::milliseconds>(
1287  std::chrono::system_clock::now().time_since_epoch())
1288  .count() &
1289  0xffffff;
1290  return 3;
1291 }

+ 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 1425 of file TableFunctionsTesting.hpp.

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

1433  {
1434  // sorted set of common coordinates:
1435  std::set<int32_t, std::less<int32_t>> x12;
1436  // inverse map of coordinates and indices, keys are sorted:
1437  std::map<int32_t, int32_t, std::less<int32_t>> i1, i2;
1438 
1439  for (int32_t i = 0; i < x1.size(); i++) {
1440  i1[x1[i]] = i;
1441  x12.insert(x1[i]);
1442  }
1443  for (int32_t i = 0; i < x2.size(); i++) {
1444  i2[x2[i]] = i;
1445  x12.insert(x2[i]);
1446  }
1447  auto size = x12.size();
1448 
1449  mgr.set_output_row_size(size);
1450  int32_t k = 0;
1451  for (auto x_ : x12) {
1452  x[k] = x_;
1453  auto i1_ = i1.find(x_);
1454  auto i2_ = i2.find(x_);
1455  if (i1_ != i1.end()) {
1456  if (i2_ != i2.end()) {
1457  d[k] = d1[i1_->second] + d2[i2_->second];
1458  } else {
1459  d[k] = d1[i1_->second] + f2;
1460  }
1461  } else if (i2_ != i2.end()) {
1462  d[k] = f1 + d2[i2_->second];
1463  } else {
1464  d[k] = f1 + f2;
1465  }
1466  d[k] *= size;
1467  k++;
1468  }
1469  return size;
1470 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_string_concat__cpu_ ( TableFunctionManager mgr,
const ColumnList< TextEncodingDict > &  input_strings,
const TextEncodingNone separator,
Column< TextEncodingDict > &  concatted_string 
)

Definition at line 702 of file TableFunctionsTesting.hpp.

References TextEncodingNone::getString(), Column< TextEncodingDict >::getStringId(), ColumnList< TextEncodingDict >::numCols(), TableFunctionManager::set_output_row_size(), Column< TextEncodingDict >::setNull(), and ColumnList< TextEncodingDict >::size().

705  {
706  const int64_t num_rows = input_strings.size();
707  const int64_t num_cols = input_strings.numCols();
708  const std::string separator_str{separator.getString()};
709  mgr.set_output_row_size(num_rows);
710  for (int64_t row_idx = 0; row_idx < num_rows; row_idx++) {
711  if (num_cols > 0) {
712  std::string concatted_output{input_strings[0].getString(row_idx)};
713  for (int64_t col_idx = 1; col_idx < num_cols; ++col_idx) {
714  concatted_output += separator_str;
715  concatted_output += input_strings[col_idx].getString(row_idx);
716  }
717  const TextEncodingDict concatted_str_id =
718  concatted_string.getStringId(concatted_output);
719  concatted_string[row_idx] = concatted_str_id;
720  } else {
721  concatted_string.setNull(row_idx);
722  }
723  }
724  return num_rows;
725 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
std::string getString() const
Definition: heavydbTypes.h:162
DEVICE int64_t size() const
Definition: heavydbTypes.h:602
DEVICE void setNull(int64_t index)
Definition: heavydbTypes.h:502
DEVICE const TextEncodingDict getStringId(const std::string &str)
Definition: heavydbTypes.h:509
DEVICE int64_t numCols() const
Definition: heavydbTypes.h:603

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_string_to_chars__cpu_ ( const TextEncodingNone input,
Column< int32_t > &  char_idx,
Column< int8_t > &  char_bytes 
)

Definition at line 1230 of file TableFunctionsTesting.hpp.

References TextEncodingNone::getString(), and set_output_row_size().

1232  {
1233  const std::string str{input.getString()};
1234  const int64_t str_size(str.size());
1235  set_output_row_size(str_size);
1236  for (int32_t i = 0; i < str_size; ++i) {
1237  char_idx[i] = i;
1238  char_bytes[i] = str[i];
1239  }
1240  return str_size;
1241 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
std::string getString() const
Definition: heavydbTypes.h:162

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_substr__cpu_ ( TableFunctionManager mgr,
const Column< TextEncodingDict > &  input_str,
const Column< int > &  pos,
const Column< int > &  len,
Column< TextEncodingDict > &  output_substr 
)

Definition at line 680 of file TableFunctionsTesting.hpp.

References Column< TextEncodingDict >::getString(), Column< TextEncodingDict >::getStringId(), TableFunctionManager::set_output_row_size(), Column< TextEncodingDict >::size(), and substring().

684  {
685  const int64_t num_rows = input_str.size();
686  mgr.set_output_row_size(num_rows);
687  for (int64_t row_idx = 0; row_idx < num_rows; row_idx++) {
688  const std::string input_string{input_str.getString(row_idx)};
689  const std::string substring = input_string.substr(pos[row_idx], len[row_idx]);
690  const TextEncodingDict substr_id = output_substr.getStringId(substring);
691  output_substr[row_idx] = substr_id;
692  }
693  return num_rows;
694 }
DEVICE const std::string getString(int64_t index) const
Definition: heavydbTypes.h:506
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
DEVICE const TextEncodingDict getStringId(const std::string &str)
Definition: heavydbTypes.h:509
DEVICE int64_t size() const
Definition: heavydbTypes.h:498
std::pair< std::string_view, const char * > substring(const std::string &str, size_t substr_length)
return substring of str with postfix if str.size() &gt; substr_length

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_synthesize_new_dict__cpu_ ( TableFunctionManager mgr,
const int64_t  num_strings,
Column< TextEncodingDict > &  new_dict_col 
)

Definition at line 733 of file TableFunctionsTesting.hpp.

References Column< TextEncodingDict >::getStringId(), TableFunctionManager::set_output_row_size(), and to_string().

735  {
736  mgr.set_output_row_size(num_strings);
737  for (int32_t s = 0; s < num_strings; ++s) {
738  const std::string new_string = "String_" + std::to_string(s);
739  const int32_t string_id = new_dict_col.getStringId(new_string);
740  new_dict_col[s] = string_id;
741  }
742  return num_strings;
743 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
std::string to_string(char const *&&v)
DEVICE const TextEncodingDict getStringId(const std::string &str)
Definition: heavydbTypes.h:509

+ Here is the call graph for this function:

template<typename T >
NEVER_INLINE HOST int32_t ct_templated_no_cursor_user_constant_sizer__cpu_template ( const T  input_num,
int32_t  c,
Column< T > &  output 
)

Definition at line 1041 of file TableFunctionsTesting.hpp.

1043  {
1044  for (int32_t i = 0; i < c; i++) {
1045  output[i] = input_num;
1046  }
1047  return c;
1048 }
EXTENSION_NOINLINE int32_t ct_test_nullable ( const Column< int32_t > &  input,
const int32_t  i,
Column< int32_t > &  out 
)

Definition at line 1789 of file TableFunctionsTesting.hpp.

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

1791  {
1792  for (int i = 0; i < input.size(); i++) {
1793  if (i % 2 == 0) {
1794  out.setNull(i);
1795  } else {
1796  out[i] = input[i];
1797  }
1798  }
1799  return input.size();
1800 }
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
DEVICE void setNull(int64_t index)
Definition: heavydbTypes.h:448

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_test_preflight_multicursor_qe227__cpu_ ( TableFunctionManager mgr,
const Column< int32_t > &  col,
const ColumnList< int32_t > &  lst,
const int  x,
const int  y,
Column< int32_t > &  out 
)

Definition at line 1861 of file TableFunctionsTesting.hpp.

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

1866  {
1867  mgr.set_output_row_size(lst.numCols() + 1);
1868  out[0] = col[1];
1869  for (int i = 0; i < lst.numCols(); i++) {
1870  out[i + 1] = lst[i][1];
1871  }
1872  return out.size();
1873 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
DEVICE int64_t numCols() const
Definition: heavydbTypes.h:567

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_test_preflight_singlecursor_qe227__cpu_ ( TableFunctionManager mgr,
const Column< int32_t > &  col,
const ColumnList< int32_t > &  lst,
const int  x,
const int  y,
Column< int32_t > &  out 
)

Definition at line 1837 of file TableFunctionsTesting.hpp.

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

1842  {
1843  mgr.set_output_row_size(lst.numCols() + 1);
1844  out[0] = col[0];
1845  for (int i = 0; i < lst.numCols(); i++) {
1846  out[i + 1] = lst[i][0];
1847  }
1848  return out.size();
1849 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
DEVICE int64_t numCols() const
Definition: heavydbTypes.h:567

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_test_preflight_sizer ( const Column< int32_t > &  input,
const int32_t  i,
const int32_t  j,
Column< int32_t > &  out 
)

Definition at line 1809 of file TableFunctionsTesting.hpp.

References Column< T >::size().

1812  {
1813  out[0] = 123;
1814  out[1] = 456;
1815  return out.size();
1816 }
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_test_preflight_sizer_const ( const Column< int32_t > &  input,
Column< int32_t > &  out 
)

Definition at line 1818 of file TableFunctionsTesting.hpp.

References Column< T >::size().

1819  {
1820  out[0] = 789;
1821  out[1] = 321;
1822  return out.size();
1823 }
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ 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 1358 of file TableFunctionsTesting.hpp.

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

1360  {
1361  int64_t num_rows = input.size();
1362  mgr.set_output_row_size(num_rows);
1363  for (int64_t r = 0; r < num_rows; ++r) {
1364  if (input[r] > 100) {
1365  return mgr.ERROR_MESSAGE("Values greater than 100 not allowed");
1366  }
1367  output[r] = input[r];
1368  }
1369  return num_rows;
1370 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_timestamp_add_offset ( TableFunctionManager mgr,
const Column< Timestamp > &  input,
const Timestamp  offset,
Column< Timestamp > &  out 
)

Definition at line 1966 of file TableFunctionsTesting.hpp.

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

1969  {
1970  int size = input.size();
1971  mgr.set_output_row_size(size);
1972  for (int i = 0; i < size; ++i) {
1973  if (input.isNull(i)) {
1974  out.setNull(i);
1975  } else {
1976  out[i] = input[i] + offset;
1977  }
1978  }
1979  return size;
1980 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
DEVICE bool isNull(int64_t index) const
Definition: heavydbTypes.h:447
DEVICE void setNull(int64_t index)
Definition: heavydbTypes.h:448

+ Here is the call graph for this function:

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 2002 of file TableFunctionsTesting.hpp.

References TableFunctionManager::set_output_row_size().

2005  {
2006  mgr.set_output_row_size(1);
2007  out[0] = 1;
2008  return 1;
2009 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655

+ 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 1926 of file TableFunctionsTesting.hpp.

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

1936  {
1937  int size = input.size();
1938  mgr.set_output_row_size(size);
1939  for (int i = 0; i < size; ++i) {
1940  if (input.isNull(i)) {
1941  ns.setNull(i);
1942  us.setNull(i);
1943  ms.setNull(i);
1944  s.setNull(i);
1945  m.setNull(i);
1946  h.setNull(i);
1947  d.setNull(i);
1948  mo.setNull(i);
1949  y.setNull(i);
1950  } else {
1951  ns[i] = input[i].getNanoseconds();
1952  us[i] = input[i].getMicroseconds();
1953  ms[i] = input[i].getMilliseconds();
1954  s[i] = input[i].getSeconds();
1955  m[i] = input[i].getMinutes();
1956  h[i] = input[i].getHours();
1957  d[i] = input[i].getDay();
1958  mo[i] = input[i].getMonth();
1959  y[i] = input[i].getYear();
1960  }
1961  }
1962  return size;
1963 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
DEVICE bool isNull(int64_t index) const
Definition: heavydbTypes.h:447
DEVICE void setNull(int64_t index)
Definition: heavydbTypes.h:448

+ 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 1984 of file TableFunctionsTesting.hpp.

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

1988  {
1989  int size = input.size();
1990  for (int i = 0; i < size; ++i) {
1991  if (input.isNull(i)) {
1992  out.setNull(i);
1993  } else {
1994  out[i] = input[i] + input2[i] + dummy;
1995  }
1996  }
1997  return size;
1998 }
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
DEVICE bool isNull(int64_t index) const
Definition: heavydbTypes.h:447
DEVICE void setNull(int64_t index)
Definition: heavydbTypes.h:448

+ 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 2011 of file TableFunctionsTesting.hpp.

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

2020  {
2021  int size = input.size();
2022  mgr.set_output_row_size(size);
2023  for (int i = 0; i < size; ++i) {
2024  y[i] = input[i].truncateToYear();
2025  mo[i] = input[i].truncateToMonth();
2026  d[i] = input[i].truncateToDay();
2027  h[i] = input[i].truncateToHours();
2028  m[i] = input[i].truncateToMinutes();
2029  s[i] = input[i].truncateToSeconds();
2030  ms[i] = input[i].truncateToMilliseconds();
2031  us[i] = input[i].truncateToMicroseconds();
2032  }
2033 
2034  return size;
2035 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
DEVICE int64_t size() const
Definition: heavydbTypes.h:445

+ Here is the call graph for this function:

EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer1a__cpu_1 ( const Column< int32_t > &  input1,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 339 of file TableFunctionsTesting.hpp.

341  {
342  out[0] = 1000 + 1 + 10 * multiplier;
343  return 1;
344 }
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer1b__cpu_2 ( const Column< int32_t > &  input1,
const Column< int32_t > &  input2,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 346 of file TableFunctionsTesting.hpp.

349  {
350  out[0] = 1000 + 2 + 11 * multiplier;
351  return 1;
352 }
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer1c__cpu_3 ( const Column< int32_t > &  input1,
const Column< int32_t > &  input2,
const Column< int32_t > &  input3,
const int32_t  multiplier,
const Column< int32_t > &  input4,
const int32_t  x,
Column< int32_t > &  out 
)

Definition at line 354 of file TableFunctionsTesting.hpp.

360  {
361  out[0] = 1000 + 101 + 10 * multiplier + x;
362  return 1;
363 }
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer1d__cpu_4 ( const int32_t  multiplier,
const int32_t  x,
const Column< int32_t > &  input1,
Column< int32_t > &  out 
)

Definition at line 365 of file TableFunctionsTesting.hpp.

368  {
369  out[0] = 1000 + 99 + 10 * multiplier + x;
370  return 1;
371 }
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer2a__cpu_1 ( const Column< int32_t > &  input1,
const int32_t  x,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 373 of file TableFunctionsTesting.hpp.

376  {
377  out[0] = 1000 + 98 + multiplier + 10 * x;
378  return 1;
379 }
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer2b__cpu_2 ( const Column< int32_t > &  input1,
const int32_t  multiplier,
const Column< int32_t > &  input2,
Column< int32_t > &  out 
)

Definition at line 381 of file TableFunctionsTesting.hpp.

384  {
385  out[0] = 1000 + 2 + multiplier;
386  return 1;
387 }
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer2c__cpu_3 ( const int32_t  x,
const int32_t  multiplier,
const Column< int32_t > &  input1,
Column< int32_t > &  out 
)

Definition at line 389 of file TableFunctionsTesting.hpp.

392  {
393  out[0] = 1000 + 99 + multiplier + 11 * x;
394  return 1;
395 }
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer3a__cpu_1 ( const Column< int32_t > &  input1,
const int32_t  multiplier,
const int32_t  x,
Column< int32_t > &  out 
)

Definition at line 397 of file TableFunctionsTesting.hpp.

400  {
401  out[0] = 1000 + 98 + 100 * multiplier + x;
402  return 1;
403 }
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer3b__cpu_2 ( const Column< int32_t > &  input1,
const int32_t  x,
const Column< int32_t > &  input2,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 405 of file TableFunctionsTesting.hpp.

409  {
410  out[0] = 1000 + 99 + 100 * multiplier + x;
411  return 1;
412 }
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer4a__cpu_1 ( const Column< int32_t > &  input1,
const int32_t  multiplier,
const Column< int32_t > &  input2,
const int32_t  x,
Column< int32_t > &  out 
)

Definition at line 414 of file TableFunctionsTesting.hpp.

418  {
419  out[0] = 1000 + 99 + 10 * multiplier + x;
420  return 1;
421 }
EXTENSION_NOINLINE_HOST int32_t ct_udtf_default_sizer4b__cpu_2 ( const int32_t  multiplier,
const Column< int32_t > &  input,
const int32_t  x,
Column< int32_t > &  out 
)

Definition at line 423 of file TableFunctionsTesting.hpp.

426  {
427  out[0] = 1000 + 99 + 9 * multiplier + x;
428  return 1;
429 }
template<typename K , typename T , typename Z >
NEVER_INLINE HOST int32_t ct_union_pushdown_projection__cpu_template ( TableFunctionManager mgr,
const Column< K > &  input1_id,
const Column< T > &  input1_x,
const Column< T > &  input1_y,
const Column< Z > &  input1_z,
const Column< K > &  input2_id,
const Column< T > &  input2_x,
const Column< T > &  input2_y,
const Column< Z > &  input2_z,
const Column< T > &  input2_w,
Column< K > &  output_id,
Column< T > &  output_x,
Column< T > &  output_y,
Column< Z > &  output_z,
Column< T > &  output_w 
)

Definition at line 1620 of file TableFunctionsTesting.hpp.

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

1634  {
1635  const int64_t input1_size = input1_id.size();
1636  const int64_t input2_size = input2_id.size();
1637  int64_t output_size = input1_size + input2_size;
1638  mgr.set_output_row_size(output_size);
1639  for (int64_t input1_idx = 0; input1_idx < input1_size; ++input1_idx) {
1640  output_id[input1_idx] = input1_id[input1_idx];
1641  output_x[input1_idx] = input1_x[input1_idx];
1642  output_y[input1_idx] = input1_y[input1_idx];
1643  output_z[input1_idx] = input1_z[input1_idx];
1644  output_w.setNull(input1_idx);
1645  }
1646  for (int64_t input2_idx = 0; input2_idx < input2_size; ++input2_idx) {
1647  output_id[input1_size + input2_idx] = input2_id[input2_idx];
1648  output_x[input1_size + input2_idx] = input2_x[input2_idx];
1649  output_y[input1_size + input2_idx] = input2_y[input2_idx];
1650  output_z[input1_size + input2_idx] = input2_z[input2_idx];
1651  output_w[input1_size + input2_idx] = input2_w[input2_idx];
1652  }
1653  return output_size;
1654 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
DEVICE void setNull(int64_t index)
Definition: heavydbTypes.h:448

+ Here is the call graph for this function:

template<typename K , typename T , typename Z >
NEVER_INLINE HOST int32_t ct_union_pushdown_stats__cpu_template ( TableFunctionManager mgr,
const TextEncodingNone agg_type,
const Column< K > &  input1_id,
const Column< T > &  input1_x,
const Column< T > &  input1_y,
const Column< Z > &  input1_z,
const Column< K > &  input2_id,
const Column< T > &  input2_x,
const Column< T > &  input2_y,
const Column< Z > &  input2_z,
const Column< T > &  input2_w,
Column< int32_t > &  output_row_count,
Column< K > &  output_id,
Column< T > &  output_x,
Column< T > &  output_y,
Column< Z > &  output_z,
Column< T > &  output_w 
)

Definition at line 1574 of file TableFunctionsTesting.hpp.

References get_column_min_max(), get_min_or_max_union(), TextEncodingNone::getString(), MAX, MIN, TableFunctionManager::set_output_row_size(), Column< T >::setNull(), and Column< T >::size().

1590  {
1591  mgr.set_output_row_size(1);
1592  const std::string agg_type_str = agg_type.getString();
1593  const TFAggType min_or_max = agg_type_str == "MIN" ? TFAggType::MIN : TFAggType::MAX;
1594  output_row_count[0] = input1_id.size() + input2_id.size();
1595  output_id[0] = get_min_or_max_union(input1_id, input2_id, min_or_max);
1596  output_x[0] = get_min_or_max_union(input1_x, input2_x, min_or_max);
1597  output_y[0] = get_min_or_max_union(input1_y, input2_y, min_or_max);
1598  output_z[0] = get_min_or_max_union(input1_z, input2_z, min_or_max);
1599  if (input2_w.size() > 0) {
1600  const auto w_min_max = get_column_min_max(input2_w);
1601  output_w[0] = agg_type_str == "MIN" ? w_min_max.first : w_min_max.second;
1602  } else {
1603  output_w.setNull(0);
1604  }
1605  return 1;
1606 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:655
std::string getString() const
Definition: heavydbTypes.h:162
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
TEMPLATE_NOINLINE std::pair< T, T > get_column_min_max(const Column< T > &col)
TEMPLATE_INLINE T get_min_or_max_union(const Column< T > &col1, const Column< T > &col2, const TFAggType min_or_max)
DEVICE void setNull(int64_t index)
Definition: heavydbTypes.h:448

+ Here is the call graph for this function:

template<typename T >
TEMPLATE_INLINE T get_min_or_max ( const Column< T > &  col,
const TFAggType  min_or_max 
)

Definition at line 1477 of file TableFunctionsTesting.hpp.

References get_column_min_max(), and MIN.

Referenced by ct_pushdown_stats__cpu_template().

1477  {
1478  const auto input_min_max = get_column_min_max(col);
1479  if (min_or_max == TFAggType::MIN) {
1480  return input_min_max.first;
1481  }
1482  return input_min_max.second;
1483 }
TEMPLATE_NOINLINE std::pair< T, T > get_column_min_max(const Column< T > &col)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
TEMPLATE_INLINE T get_min_or_max_union ( const Column< T > &  col1,
const Column< T > &  col2,
const TFAggType  min_or_max 
)

Definition at line 1486 of file TableFunctionsTesting.hpp.

References get_column_min_max(), and MIN.

Referenced by ct_union_pushdown_stats__cpu_template().

1488  {
1489  const auto input1_min_max = get_column_min_max(col1);
1490  const auto input2_min_max = get_column_min_max(col2);
1491  if (min_or_max == TFAggType::MIN) {
1492  return input1_min_max.first < input2_min_max.first ? input1_min_max.first
1493  : input2_min_max.first;
1494  }
1495  return input1_min_max.second > input2_min_max.second ? input1_min_max.second
1496  : input2_min_max.second;
1497 }
TEMPLATE_NOINLINE std::pair< T, T > get_column_min_max(const Column< T > &col)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
T safe_addition ( x,
y 
)

Definition at line 1096 of file TableFunctionsTesting.hpp.

Referenced by column_list_safe_row_sum__cpu_template().

1096  {
1097  if (x >= 0) {
1098  if (y > (std::numeric_limits<T>::max() - x)) {
1099  throw std::overflow_error("Addition overflow detected");
1100  }
1101  } else {
1102  if (y < (std::numeric_limits<T>::min() - x)) {
1103  throw std::underflow_error("Addition underflow detected");
1104  }
1105  }
1106  return x + y;
1107 }

+ 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 797 of file TableFunctionsTesting.hpp.

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

801  {
802  const int64_t num_rows = input.size();
803  set_output_row_size(num_rows);
804  output = input;
805  if (sort_ascending) {
806  std::sort(output.ptr_, output.ptr_ + num_rows, SortAsc<T>(nulls_last));
807  } else {
808  std::sort(output.ptr_, output.ptr_ + num_rows, SortDesc<T>(nulls_last));
809  }
810  if (limit < 0 || limit > num_rows) {
811  return num_rows;
812  }
813  return limit;
814 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
Definition: heavydbTypes.h:445
DEVICE void sort(ARGS &&...args)
Definition: gpu_enabled.h:105
T * ptr_
Definition: heavydbTypes.h:430

+ Here is the call graph for this function: