OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TableFunctionsTesting.h File Reference
+ Include dependency graph for TableFunctionsTesting.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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 >
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 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_HOST int32_t ct_require_text_collist_enc_dict__cpu_ (const ColumnList< TextEncodingDict > &input, const int64_t x, Column< int64_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_require_cursor__cpu_ (const Column< int64_t > &input, int64_t y, Column< int64_t > &out)
 
EXTENSION_NOINLINE_HOST int32_t ct_test_allocator (TableFunctionManager &mgr, const Column< int32_t > &input, const TextEncodingNone &t, Column< int32_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_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<typename T >
NEVER_INLINE HOST int32_t sum_along_row__cpu_template (const Column< Array< T >> &input, Column< T > &output)
 
template<typename T >
NEVER_INLINE HOST int32_t array_copier__cpu_template (TableFunctionManager &mgr, const Column< Array< T >> &input, Column< Array< T >> &output)
 
template<typename T >
NEVER_INLINE HOST int32_t array_concat__cpu_template (TableFunctionManager &mgr, const ColumnList< Array< T >> &inputs, Column< Array< T >> &output)
 
template<typename T >
NEVER_INLINE HOST int32_t array_append__cpu_template (TableFunctionManager &mgr, const Column< Array< T >> &input1, const Array< T > &input2, Column< Array< T >> &output)
 
template<typename T >
NEVER_INLINE HOST int32_t array_asarray__cpu_template (TableFunctionManager &mgr, const Column< T > &input, Column< Array< T >> &output)
 
template<typename T >
NEVER_INLINE HOST int32_t array_split__cpu_template (TableFunctionManager &mgr, const Column< Array< T >> &input, Column< Array< T >> &first, Column< Array< T >> &second)
 
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)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_overload_scalar_test__cpu_template (const T scalar, Column< T > &out)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_overload_column_test__cpu_template (const Column< T > &input, Column< T > &out)
 
template<typename T , typename K >
NEVER_INLINE HOST int32_t ct_overload_column_list_test__cpu_template (const Column< K > &first_col, const ColumnList< T > &col_list, const Column< K > &last_col, Column< K > &out)
 
template<typename T , typename K >
NEVER_INLINE HOST int32_t ct_overload_column_list_test2__cpu_template (const Column< K > &first_col, const ColumnList< K > &col_list1, const ColumnList< T > &col_list2, const Column< T > &last_col, Column< K > &out)
 
EXTENSION_NOINLINE int32_t ct_require_range__cpu_ (const Column< int32_t > &input1, const int32_t x, const int32_t multiplier, Column< int32_t > &out)
 
EXTENSION_NOINLINE int32_t ct_coords__cpu_ (TableFunctionManager &mgr, const Column< GeoPoint > &points, Column< double > &xcoords, Column< double > &ycoords)
 
EXTENSION_NOINLINE int32_t ct_shift__cpu_ (TableFunctionManager &mgr, const Column< GeoPoint > &points, const double x, const double y, Column< GeoPoint > &shifted_points)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_pointn__cpu_template (TableFunctionManager &mgr, const Column< T > &points, int64_t n, Column< double > &xcoords, Column< double > &ycoords)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_copy__generic_cpu_template (TableFunctionManager &mgr, const Column< T > &inputs, Column< T > &outputs)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_concat__generic_cpu_template (TableFunctionManager &mgr, const Column< T > &input1, const Column< T > &input2, Column< T > &outputs)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_concat__generic2_cpu_template (TableFunctionManager &mgr, const Column< T > &input1, const T &input2, Column< T > &outputs)
 
template<typename T >
NEVER_INLINE HOST int32_t ct_concat__generic3_cpu_template (TableFunctionManager &mgr, const T &input1, const Column< T > &input2, Column< T > &outputs)
 
EXTENSION_NOINLINE int32_t ct_linestringn__cpu_ (TableFunctionManager &mgr, const Column< GeoPolygon > &polygons, int64_t n, Column< GeoLineString > &linestrings)
 
EXTENSION_NOINLINE int32_t ct_make_polygon3__cpu_ (TableFunctionManager &mgr, const Column< GeoLineString > &rings, const Column< GeoLineString > &holes1, const Column< GeoLineString > &holes2, Column< GeoPolygon > &polygons, Column< int > &sizes)
 
EXTENSION_NOINLINE int32_t ct_make_linestring2__cpu_ (TableFunctionManager &mgr, const Column< double > &x, const Column< double > &y, double dx, double dy, Column< GeoLineString > &linestrings)
 
EXTENSION_NOINLINE int32_t ct_make_multipolygon__cpu_ (TableFunctionManager &mgr, const Column< GeoPolygon > &polygons, Column< GeoMultiPolygon > &mpolygons)
 
EXTENSION_NOINLINE int32_t ct_polygonn__cpu_ (TableFunctionManager &mgr, const Column< GeoMultiPolygon > &mpolygons, int64_t n, Column< GeoPolygon > &polygons)
 
EXTENSION_NOINLINE int32_t ct_to_multilinestring__cpu_ (TableFunctionManager &mgr, const Column< GeoPolygon > &polygons, Column< GeoMultiLineString > &mlinestrings)
 
EXTENSION_NOINLINE int32_t ct_to_polygon__cpu_ (TableFunctionManager &mgr, const Column< GeoMultiLineString > &mlinestrings, Column< GeoPolygon > &polygons)
 
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)
 
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)
 
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)
 
template<typename T >
TEMPLATE_NOINLINE int32_t ct_test_int_default_arg__template (const Column< T > &inp, const T x, const int32_t multiplier, Column< T > &out)
 
template<typename T >
TEMPLATE_NOINLINE int32_t ct_test_float_default_arg__template (const Column< T > &inp, const T x, const int32_t multiplier, Column< T > &out)
 
EXTENSION_NOINLINE int32_t ct_test_string_default_arg__cpu_ (TableFunctionManager &mgr, const Column< TextEncodingDict > &inp, const TextEncodingNone &suffix, Column< TextEncodingDict > &out)
 
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)
 
EXTENSION_NOINLINE int32_t ct_test_calcite_casting_char__cpu_ (TableFunctionManager &mgr, const Column< TextEncodingDict > &input1, Column< TextEncodingDict > &out)
 
EXTENSION_NOINLINE int32_t ct_test_calcite_casting_bigint__cpu_ (TableFunctionManager &mgr, const Column< int64_t > &input1, Column< int64_t > &out)
 
EXTENSION_NOINLINE int32_t ct_test_calcite_casting_double__cpu_ (TableFunctionManager &mgr, const Column< double > &input1, Column< double > &out)
 
EXTENSION_NOINLINE int32_t ct_test_calcite_casting_timestamp__cpu_ (TableFunctionManager &mgr, const Column< Timestamp > &input1, Column< Timestamp > &out)
 
template<typename T >
TEMPLATE_NOINLINE int32_t ct_test_calcite_casting_columnlist__template_cpu_ (TableFunctionManager &mgr, const Column< T > &first, const ColumnList< T > &list, Column< T > &out)
 

Function Documentation

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

Definition at line 177 of file ArrayTestTableFunctions.cpp.

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

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

+ Here is the call graph for this function:

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

Definition at line 270 of file ArrayTestTableFunctions.cpp.

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

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

+ Here is the call graph for this function:

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

Definition at line 149 of file ArrayTestTableFunctions.cpp.

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

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

+ Here is the call graph for this function:

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

Definition at line 89 of file ArrayTestTableFunctions.cpp.

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

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

+ Here is the call graph for this function:

template<typename T >
NEVER_INLINE HOST int32_t array_split__cpu_template ( TableFunctionManager mgr,
const Column< Array< T >> &  input,
Column< Array< T >> &  first,
Column< Array< T >> &  second 
)

Definition at line 328 of file ArrayTestTableFunctions.cpp.

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

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

+ Here is the call graph for this function:

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:

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 , 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 28 of file SignatureTestTableFunctions.cpp.

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

30  {
31  if constexpr (std::is_same<T, TextEncodingDict>::value &&
32  std::is_same<U, TextEncodingDict>::value) {
33  set_output_row_size(input1.size());
34  for (int64_t i = 0; i < input1.size(); i++) {
35  out[i] = input1[i];
36  }
37  return input1.size();
38  }
39 
41  if constexpr (std::is_same<T, int32_t>::value && std::is_same<U, double>::value) {
42  out[0] = 10;
43  } else if constexpr (std::is_same<T, double>::value && std::is_same<U, double>::value) {
44  out[0] = 20;
45  } else if constexpr (std::is_same<T, int32_t>::value &&
46  std::is_same<U, int32_t>::value) {
47  out[0] = 30;
48  } else if constexpr (std::is_same<T, double>::value &&
49  std::is_same<U, int32_t>::value) {
50  out[0] = 40;
51  }
52  return 1;
53 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const

+ 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 507 of file RbcTestTableFunctions.cpp.

References set_output_row_size().

508  {
510  if constexpr (std::is_same<T, int32_t>::value) {
511  out[0] = 10;
512  } else {
513  out[0] = 20;
514  }
515  return 1;
516 }
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 468 of file RbcTestTableFunctions.cpp.

References set_output_row_size().

470  {
472  if constexpr (std::is_same<T, int32_t>::value) {
473  out[0] = 1;
474  } else if constexpr (std::is_same<T, float>::value) {
475  out[0] = 2;
476  } else if constexpr (std::is_same<T, TextEncodingDict>::value) {
477  out[0] = 3;
478  } else {
479  out[0] = 4;
480  }
481  return 1;
482 }
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 370 of file RbcTestTableFunctions.cpp.

References Column< TextEncodingDict >::size().

372  {
373  for (int64_t i = 0; i < input.size(); i++) {
374  out[i] = input[i]; // assign string id
375  }
376  return multiplier * input.size();
377 }
DEVICE int64_t size() const

+ 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 380 of file RbcTestTableFunctions.cpp.

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

383  {
384  set_output_row_size(input1.size());
385  for (int64_t i = 0; i < input1.size(); i++) {
386  out1[i] = input1[i];
387  out2[i] = input2[i];
388  }
389  return input1.size();
390 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const

+ 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 393 of file RbcTestTableFunctions.cpp.

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

396  {
397  set_output_row_size(input1.size());
398  for (int64_t i = 0; i < input1.size(); i++) {
399  out1[i] = input2[i];
400  out2[i] = input1[i];
401  }
402  return input1.size();
403 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const

+ 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 406 of file RbcTestTableFunctions.cpp.

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

407  {
408  int64_t sz = input[0].size();
410  for (int64_t i = 0; i < sz; i++) {
411  out[i] = input[0][i];
412  }
413  return sz;
414 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const

+ 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 417 of file RbcTestTableFunctions.cpp.

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

418  {
419  int64_t sz = input[1].size();
421  for (int64_t i = 0; i < sz; i++) {
422  out[i] = input[1][i];
423  }
424  return sz;
425 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const

+ 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 428 of file RbcTestTableFunctions.cpp.

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

430  {
431  int64_t sz = input[0].size();
433  for (int64_t i = 0; i < sz; i++) {
434  out0[i] = input[0][i];
435  out1[i] = input[1][i];
436  }
437  return sz;
438 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
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:

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 40 of file StringTestTableFunctions.cpp.

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

42  {
43  const int64_t num_rows = input_strings.size();
44  const int64_t num_cols = input_strings.numCols();
45  set_output_row_size(num_rows);
46  for (int64_t r = 0; r < num_rows; r++) {
47  bool are_equal = true;
48  if (num_cols > 0) {
49  std::string first_str = input_strings[0].getString(r);
50  for (int64_t c = 1; c != num_cols; ++c) {
51  if (input_strings[c].getString(r) != first_str) {
52  are_equal = false;
53  break;
54  }
55  }
56  strings_are_equal[r] = are_equal;
57  if (are_equal && num_cols > 0) {
58  string_if_equal[r] = input_strings[0][r];
59  } else {
60  string_if_equal.setNull(r);
61  }
62  }
63  }
64  return num_rows;
65 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
DEVICE void setNull(int64_t index)
DEVICE int64_t numCols() const

+ 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 26 of file StringTestTableFunctions.cpp.

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

28  {
29  const int64_t num_rows = input_str.size();
30  set_output_row_size(num_rows);
31  for (int64_t i = 0; i < num_rows; i++) {
32  out_str[i] = input_str[i];
33  const std::string str = input_str.getString(i);
34  out_size[i] = str.size();
35  }
36  return num_rows;
37 }
DEVICE const std::string getString(int64_t index) const
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
DEVICE int64_t size() const

+ 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 445 of file RbcTestTableFunctions.cpp.

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

446  {
447  set_output_row_size(input.size());
448  for (int64_t i = 0; i < input.size(); i++) {
449  out[i] = input[i];
450  }
451  return input.size();
452 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const

+ 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 227 of file RbcTestTableFunctions.cpp.

229  {
230  out[0] = 1000 + 91 + multiplier;
231  return 1;
232 }
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 256 of file RbcTestTableFunctions.cpp.

259  {
260  out[0] = 1000 + 169 + multiplier + 10 * input2;
261  return 1;
262 }
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 241 of file RbcTestTableFunctions.cpp.

244  {
245  out[0] = 1000 + 396 + multiplier + 10 * input2;
246  return 1;
247 }
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 249 of file RbcTestTableFunctions.cpp.

252  {
253  out[0] = 1000 + 369 + multiplier + 10 * input2;
254  return 1;
255 }
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 233 of file RbcTestTableFunctions.cpp.

236  {
237  out[0] = 1000 + 196 + multiplier + 10 * input2;
238  return 1;
239 }
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 152 of file RbcTestTableFunctions.cpp.

154  {
155  out[0] = 1000 + 19 + multiplier;
156  return 1;
157 }
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 158 of file RbcTestTableFunctions.cpp.

161  {
162  out[0] = 1000 + 119 + multiplier;
163  return 1;
164 }
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 165 of file RbcTestTableFunctions.cpp.

169  {
170  out[0] = 1000 + 1119 + multiplier;
171  return 1;
172 }
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 173 of file RbcTestTableFunctions.cpp.

177  {
178  out[0] = 1000 + 2119 + multiplier;
179  return 1;
180 }
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 181 of file RbcTestTableFunctions.cpp.

185  {
186  out[0] = 1000 + 2219 + multiplier;
187  return 1;
188 }
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 189 of file RbcTestTableFunctions.cpp.

193  {
194  out[0] = 1000 + 2129 + multiplier;
195  return 1;
196 }
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 197 of file RbcTestTableFunctions.cpp.

200  {
201  out[0] = 1000 + 139 + multiplier;
202  return 1;
203 }
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 204 of file RbcTestTableFunctions.cpp.

207  {
208  out[0] = 1000 + 329 + multiplier;
209  return 1;
210 }
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 211 of file RbcTestTableFunctions.cpp.

214  {
215  out[0] = 1000 + 349 + multiplier;
216  return 1;
217 }
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 218 of file RbcTestTableFunctions.cpp.

222  {
223  out[0] = 1000 + 2429 + multiplier;
224  return 1;
225 }
EXTENSION_NOINLINE_HOST int32_t ct_binding_udtf_constant__cpu_1 ( const Column< int32_t > &  input1,
Column< int32_t > &  out 
)

Definition at line 79 of file RbcTestTableFunctions.cpp.

79  {
80  out[0] = 1;
81  return 1;
82 }
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 144 of file RbcTestTableFunctions.cpp.

147  {
148  out[0] = 242;
149  return 1;
150 }
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 84 of file RbcTestTableFunctions.cpp.

86  {
87  out[0] = 11;
88  return 1;
89 }
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 91 of file RbcTestTableFunctions.cpp.

94  {
95  out[0] = 111;
96  return 1;
97 }
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 99 of file RbcTestTableFunctions.cpp.

102  {
103  out[0] = 211;
104  return 1;
105 }
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 107 of file RbcTestTableFunctions.cpp.

110  {
111  out[0] = 221;
112  return 1;
113 }
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 115 of file RbcTestTableFunctions.cpp.

118  {
119  out[0] = 212;
120  return 1;
121 }
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 123 of file RbcTestTableFunctions.cpp.

125  {
126  out[0] = 13;
127  return 1;
128 }
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 130 of file RbcTestTableFunctions.cpp.

132  {
133  out[0] = 32;
134  return 1;
135 }
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 137 of file RbcTestTableFunctions.cpp.

139  {
140  out[0] = 34;
141  return 1;
142 }
template<typename T >
NEVER_INLINE HOST int32_t ct_concat__generic2_cpu_template ( TableFunctionManager mgr,
const Column< T > &  input1,
const T &  input2,
Column< T > &  outputs 
)

Definition at line 91 of file FlatBufferTableFunctions.cpp.

94  {
95  auto size = input1.size();
97  input1.getNofValues() + size * input2.size());
98  mgr.set_output_row_size(size);
99  for (int64_t i = 0; i < size; i++) {
100  if (input1.isNull(i) || input2.isNull()) {
101  output.setNull(i);
102  } else {
103  output[i] = input1[i];
104  output[i] += input2;
105  }
106  }
107  return size;
108 }
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
void set_output_item_values_total_number(int32_t index, int64_t output_item_values_total_number)
Definition: heavydbTypes.h:367
template<typename T >
NEVER_INLINE HOST int32_t ct_concat__generic3_cpu_template ( TableFunctionManager mgr,
const T &  input1,
const Column< T > &  input2,
Column< T > &  outputs 
)

Definition at line 121 of file FlatBufferTableFunctions.cpp.

124  {
125  auto size = input2.size();
127  input2.getNofValues() + size * input1.size());
128  mgr.set_output_row_size(size);
129  for (int64_t i = 0; i < size; i++) {
130  if (input2.isNull(i) || input1.isNull()) {
131  output.setNull(i);
132  } else {
133  output[i] = input1;
134  output[i] += input2[i];
135  }
136  }
137  return size;
138 }
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
void set_output_item_values_total_number(int32_t index, int64_t output_item_values_total_number)
Definition: heavydbTypes.h:367
template<typename T >
NEVER_INLINE HOST int32_t ct_concat__generic_cpu_template ( TableFunctionManager mgr,
const Column< T > &  input1,
const Column< T > &  input2,
Column< T > &  outputs 
)

Definition at line 56 of file FlatBufferTableFunctions.cpp.

59  {
60  auto size = input1.size();
62  input1.getNofValues() + input2.getNofValues());
63  mgr.set_output_row_size(size);
64  for (int64_t i = 0; i < size; i++) {
65  if (input1.isNull(i)) {
66  if (input2.isNull(i)) {
67  outputs.setNull(i);
68  } else {
69  outputs[i] = input2[i];
70  }
71  } else if (input2.isNull(i)) {
72  outputs[i] = input1[i];
73  } else {
74  outputs[i] = input1[i];
75  outputs.concatItem(i, input2[i]);
76  }
77  }
78  return size;
79 }
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)
void set_output_item_values_total_number(int32_t index, int64_t output_item_values_total_number)
Definition: heavydbTypes.h:367
EXTENSION_NOINLINE int32_t ct_coords__cpu_ ( TableFunctionManager mgr,
const Column< GeoPoint > &  points,
Column< double > &  xcoords,
Column< double > &  ycoords 
)

Definition at line 28 of file GeoTestTableFunctions.cpp.

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

31  {
32  auto size = points.size();
33  mgr.set_output_row_size(size);
34  for (int64_t i = 0; i < size; i++) {
35  if (points.isNull(i)) {
36  xcoords.setNull(i);
37  ycoords.setNull(i);
38  } else {
39  const auto point = points[i];
40  xcoords[i] = point.x;
41  ycoords[i] = point.y;
42  }
43  }
44  return size;
45 }
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:

template<typename T >
NEVER_INLINE HOST int32_t ct_copy__generic_cpu_template ( TableFunctionManager mgr,
const Column< T > &  inputs,
Column< T > &  outputs 
)

Definition at line 28 of file FlatBufferTableFunctions.cpp.

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

30  {
31  auto size = inputs.size();
32  mgr.set_output_item_values_total_number(0, inputs.getNofValues());
33  mgr.set_output_row_size(size);
34  for (int64_t i = 0; i < size; i++) {
35  if (inputs.isNull(i)) {
36  outputs.setNull(i);
37  } else {
38  outputs[i] = inputs[i];
39  }
40  }
41  return size;
42 }
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)
void set_output_item_values_total_number(int32_t index, int64_t output_item_values_total_number)
Definition: heavydbTypes.h:367

+ Here is the call graph for this function:

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_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 508 of file SignatureTestTableFunctions.cpp.

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

514  {
515  const int32_t num_rows = input_arg1.size();
516  mgr.set_output_row_size(num_rows);
517  for (int32_t r = 0; r < num_rows; ++r) {
518  out1[r] = input_arg1[r] + arg1;
519  out2[r] = input_arg2[r] + arg2;
520  }
521  return num_rows;
522 }
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_device_selection_udtf_any ( const Column< int32_t > &  input,
Column< int64_t > &  out 
)

Definition at line 28 of file RbcTestTableFunctions.cpp.

References CPU_DEVICE_CODE, and GPU_DEVICE_CODE.

28  {
29 #ifdef __CUDACC__
30  out[0] = GPU_DEVICE_CODE;
31 #else
32  out[0] = CPU_DEVICE_CODE;
33 #endif
34  return 1;
35 }
#define GPU_DEVICE_CODE
#define CPU_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 58 of file RbcTestTableFunctions.cpp.

References CPU_DEVICE_CODE.

59  {
60  out[0] = CPU_DEVICE_CODE;
61  return 1;
62 }
#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 67 of file RbcTestTableFunctions.cpp.

References GPU_DEVICE_CODE.

68  {
69  out[0] = GPU_DEVICE_CODE;
70  return 1;
71 }
#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 40 of file RbcTestTableFunctions.cpp.

References CPU_DEVICE_CODE.

41  {
42  out[0] = CPU_DEVICE_CODE;
43  return 1;
44 }
#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 49 of file RbcTestTableFunctions.cpp.

References GPU_DEVICE_CODE.

50  {
51  out[0] = GPU_DEVICE_CODE;
52  return 1;
53 }
#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 152 of file StringTestTableFunctions.cpp.

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

156  {
157  const int32_t str_len = str.size();
158  // Note: we assume RowMultiplier is 1 for this test, was to make running on
159  // GPU easy Todo: Provide Constant RowMultiplier interface
160  if (multiplier != 1) {
161  return 0;
162  }
163  const int32_t num_input_rows = indices.size();
164  const int32_t num_output_rows = num_input_rows * multiplier;
165 
166 #ifdef __CUDACC__
167  const int32_t start = threadIdx.x + blockDim.x * blockIdx.x;
168  const int32_t step = blockDim.x * gridDim.x;
169 #else
170  const int32_t start = 0;
171  const int32_t step = 1;
172 #endif
173 
174  for (int32_t i = start; i < num_output_rows; i += step) {
175  idx[i] = indices[i % num_output_rows];
176  char_bytes[i] = str[i % str_len]; // index < str_len ? str[i] : 0;
177  }
178  return num_output_rows;
179 }
DEVICE int64_t size() const
DEVICE ALWAYS_INLINE int64_t size() const
Definition: heavydbTypes.h:688

+ 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 int32_t ct_hamming_distance ( const TextEncodingNone str1,
const TextEncodingNone str2,
Column< int32_t > &  hamming_distance 
)

Definition at line 125 of file StringTestTableFunctions.cpp.

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

127  {
128  const int32_t str_len = str1.size() <= str2.size() ? str1.size() : str2.size();
129 
130 #ifdef __CUDACC__
131  const int32_t start = threadIdx.x + blockDim.x * blockIdx.x;
132  const int32_t step = blockDim.x * gridDim.x;
133  int32_t* output_ptr = hamming_distance.ptr_;
134 #else
135  const int32_t start = 0;
136  const int32_t step = 1;
137 #endif
138 
139  int32_t num_chars_unequal = 0;
140  for (int32_t i = start; i < str_len; i += step) {
141  num_chars_unequal += (str1[i] != str2[i]) ? 1 : 0;
142  }
143 #ifdef __CUDACC__
144  atomicAdd(output_ptr, num_chars_unequal);
145 #else
146  hamming_distance[0] = num_chars_unequal;
147 #endif
148  return 1;
149 }
DEVICE ALWAYS_INLINE int64_t size() const
Definition: heavydbTypes.h:688

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_linestringn__cpu_ ( TableFunctionManager mgr,
const Column< GeoPolygon > &  polygons,
int64_t  n,
Column< GeoLineString > &  linestrings 
)

Definition at line 105 of file GeoTestTableFunctions.cpp.

References flatbuffer::Column< RowType, RowStruct >::getNofValues(), flatbuffer::Column< RowType, RowStruct >::isNull(), TableFunctionManager::set_output_item_values_total_number(), TableFunctionManager::set_output_row_size(), flatbuffer::Column< RowType, RowStruct >::setItem(), flatbuffer::Column< RowType, RowStruct >::setNull(), and flatbuffer::Column< RowType, RowStruct >::size().

108  {
109  auto size = polygons.size();
111  mgr.set_output_row_size(size);
112  for (int64_t i = 0; i < size; i++) {
113  if (polygons.isNull(i)) {
114  linestrings.setNull(i);
115  } else {
116  int64_t sz = polygons[i].size();
117  if (n < 1 || n > sz) {
118  linestrings.setNull(i);
119  } else {
120  const auto poly = polygons[i];
121  const auto ring = poly[n - 1];
122  linestrings.setItem(i, ring);
123  }
124  }
125  }
126  return size;
127 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
int64_t getNofValues() const
void set_output_item_values_total_number(int32_t index, int64_t output_item_values_total_number)
Definition: heavydbTypes.h:367
DEVICE int64_t size() const
DEVICE void setNull(int64_t index)
DEVICE bool isNull(int64_t index) const
constexpr double n
Definition: Utm.h:38
DEVICE void setItem(int64_t index, const RowType &item)

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_make_linestring2__cpu_ ( TableFunctionManager mgr,
const Column< double > &  x,
const Column< double > &  y,
double  dx,
double  dy,
Column< GeoLineString > &  linestrings 
)

Definition at line 285 of file GeoTestTableFunctions.cpp.

References Column< T >::isNull(), parse_ast::line, TableFunctionManager::set_output_item_values_total_number(), TableFunctionManager::set_output_row_size(), flatbuffer::Column< RowType, RowStruct >::setNull(), and Column< T >::size().

290  {
291  auto size = x.size();
292  mgr.set_output_item_values_total_number(0, size * 4);
293  mgr.set_output_row_size(size);
294  for (int64_t i = 0; i < size; i++) {
295  if (x.isNull(i) || y.isNull(i)) {
296  linestrings.setNull(i);
297  } else {
298  std::vector<double> line{x[i], y[i], x[i] + dx, y[i] + dy};
299  linestrings[i].fromCoords(line);
300  }
301  }
302  return size;
303 }
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
tuple line
Definition: parse_ast.py:10
void set_output_item_values_total_number(int32_t index, int64_t output_item_values_total_number)
Definition: heavydbTypes.h:367
DEVICE void setNull(int64_t index)

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_make_multipolygon__cpu_ ( TableFunctionManager mgr,
const Column< GeoPolygon > &  polygons,
Column< GeoMultiPolygon > &  mpolygons 
)

Definition at line 306 of file GeoTestTableFunctions.cpp.

References flatbuffer::Column< RowType, RowStruct >::getNofValues(), flatbuffer::Column< RowType, RowStruct >::isNull(), parse_ast::line, TableFunctionManager::set_output_item_values_total_number(), TableFunctionManager::set_output_row_size(), flatbuffer::Column< RowType, RowStruct >::setNull(), flatbuffer::Column< RowType, RowStruct >::size(), flatbuffer::NestedArray< ItemType >::size(), Geo::LineString::toCoords(), and toString().

308  {
309  auto size = polygons.size();
311  mgr.set_output_row_size(size);
312 
313  // Initialize mpolygons
314  int count_nulls = 0;
315  for (int64_t i = 0; i < size; i++) {
316  if (polygons.isNull(i)) {
317  mpolygons.setNull(i);
318  count_nulls++;
319  } else {
320  std::vector<std::vector<std::vector<double>>> mpolygon_coords;
321  mpolygon_coords.reserve(1);
322  std::vector<std::vector<double>> polygon_coords = polygons[i].toCoords();
323  mpolygon_coords.push_back(polygon_coords);
324  auto status = mpolygons[i].fromCoords(mpolygon_coords);
325  if (status != FlatBufferManager::Status::Success) {
326  return mgr.ERROR_MESSAGE("fromCoords failed: " + ::toString(status));
327  }
328  }
329  }
330 
331  // Check mpolygons content
332  if (count_nulls == 0) {
333  return mgr.ERROR_MESSAGE("counting null test failed: count_nulls=" +
334  ::toString(count_nulls) + ", expected non-zero.");
335  }
336 
337  for (int64_t i = 0; i < size; i++) {
338  if (mpolygons.isNull(i)) {
339  count_nulls--;
340  } else {
341  std::vector<std::vector<double>> polygon_coords = polygons[i].toCoords();
342 
343  // mpolygons[i] is Geo::MultiPolygon instances
344  // mpolygons[i][j] is Geo::Polygon instances
345  // mpolygons[i][j][k] is Geo::LineString instances
346  // mpolygons[i][j][k][l] is Geo::Point2D instances
347 
348  auto nof_polygons = mpolygons[i].size();
349  if (nof_polygons != 1) {
350  return mgr.ERROR_MESSAGE("multipolygon size test failed: nof_polygons=" +
351  ::toString(nof_polygons) + ", expected 1.");
352  }
353 
354  std::vector<std::vector<std::vector<double>>> mpolygon_coords =
355  mpolygons[i].toCoords();
356  if (nof_polygons != mpolygon_coords.size()) {
357  return mgr.ERROR_MESSAGE(
358  "multipolygon toCoords size test failed: mpolygon_coords.size()=" +
359  ::toString(mpolygon_coords.size()) + ", expected " +
360  ::toString(nof_polygons) + ".");
361  }
362 
363  Geo::Polygon poly = mpolygons[i][0];
364  std::vector<std::vector<double>> poly_coords = mpolygon_coords[0];
365  if (poly.size() != polygon_coords.size()) {
366  return mgr.ERROR_MESSAGE("multipolygon polygon size test failed: poly.size()=" +
367  ::toString(poly.size()) + ", expected " +
368  ::toString(polygon_coords.size()) + ".");
369  }
370 
371  if (poly_coords.size() != polygon_coords.size()) {
372  return mgr.ERROR_MESSAGE(
373  "multipolygon polygon coords size test failed: poly_coords.size()=" +
374  ::toString(poly_coords.size()) + ", expected " +
375  ::toString(polygon_coords.size()) + ".");
376  }
377 
378  for (size_t j = 0; j < poly.size(); j++) {
379  Geo::LineString line = poly[j];
380  std::vector<double> line_coords = line.toCoords();
381  auto nof_points = polygon_coords[j].size() / 2;
382  if (poly.size(j) != nof_points) {
383  return mgr.ERROR_MESSAGE(
384  "multipolygon polygon linestring size test failed: poly.size(" +
385  ::toString(j) + ")=" + ::toString(poly.size(j)) + ", expected " +
386  ::toString(nof_points) + ".");
387  }
388  if (line.size() != nof_points) {
389  return mgr.ERROR_MESSAGE(
390  "multipolygon polygon linestring size test failed: line.size()=" +
391  ::toString(line.size()) + ", expected " + ::toString(nof_points) + ".");
392  }
393  if (poly_coords[j].size() != nof_points * 2) {
394  return mgr.ERROR_MESSAGE(
395  "multipolygon polygon linestring coords size test failed: "
396  "poly_coords[j].size()=" +
397  ::toString(poly_coords[j].size()) + ", expected " +
398  ::toString(nof_points * 2) + ".");
399  }
400  if (line_coords.size() != nof_points * 2) {
401  return mgr.ERROR_MESSAGE(
402  "multipolygon polygon linestring coords size test failed: "
403  "line_coords.size()=" +
404  ::toString(line_coords.size()) + ", expected " +
405  ::toString(nof_points * 2) + ".");
406  }
407 
408  for (size_t k = 0; k < nof_points; k++) {
409  if (std::abs(polygon_coords[j][2 * k] - line_coords[2 * k]) > 1e-7) {
410  return mgr.ERROR_MESSAGE(
411  "multipolygon polygon linestring X coord test failed: line_coords[2*k]=" +
412  ::toString(line_coords[2 * k]) + ", expected " +
413  ::toString(polygon_coords[j][2 * k]) + ".");
414  }
415  if (std::abs(polygon_coords[j][2 * k] - poly_coords[j][2 * k]) > 1e-7) {
416  return mgr.ERROR_MESSAGE(
417  "multipolygon polygon X coord test failed: poly_coords[j][2*k]=" +
418  ::toString(poly_coords[j][2 * k]) + ", expected " +
419  ::toString(polygon_coords[j][2 * k]) + ".");
420  }
421  if (std::abs(polygon_coords[j][2 * k] - line[k].x) > 1e-7) {
422  return mgr.ERROR_MESSAGE(
423  "multipolygon polygon linestring X coord test failed: line[k].x=" +
424  ::toString(line[k].x) + ", expected " +
425  ::toString(polygon_coords[j][2 * k]) + ".");
426  }
427  if (std::abs(polygon_coords[j][2 * k + 1] - line_coords[2 * k + 1]) > 1e-7) {
428  return mgr.ERROR_MESSAGE(
429  "multipolygon polygon linestring Y coord test failed: "
430  "line_coords[2*k+1]=" +
431  ::toString(line_coords[2 * k + 1]) + ", expected " +
432  ::toString(polygon_coords[j][2 * k + 1]) + ".");
433  }
434  if (std::abs(polygon_coords[j][2 * k + 1] - poly_coords[j][2 * k + 1]) > 1e-7) {
435  return mgr.ERROR_MESSAGE(
436  "multipolygon polygon Y coord test failed: poly_coords[j][2*k+1]=" +
437  ::toString(poly_coords[j][2 * k + 1]) + ", expected " +
438  ::toString(polygon_coords[j][2 * k + 1]) + ".");
439  }
440  if (std::abs(polygon_coords[j][2 * k + 1] - line[k].y) > 1e-7) {
441  return mgr.ERROR_MESSAGE(
442  "multipolygon polygon linestring X coord test failed: line[k].y=" +
443  ::toString(line[k].y) + ", expected " +
444  ::toString(polygon_coords[j][2 * k + 1]) + ".");
445  }
446  }
447  }
448  }
449  }
450 
451  if (count_nulls != 0) {
452  return mgr.ERROR_MESSAGE("counting null test failed: count_nulls=" +
453  ::toString(count_nulls) + ", expected 0.");
454  }
455 
456  return size;
457 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
size_t size() const
std::vector< CT > toCoords() const
int64_t getNofValues() const
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703
tuple line
Definition: parse_ast.py:10
void set_output_item_values_total_number(int32_t index, int64_t output_item_values_total_number)
Definition: heavydbTypes.h:367
DEVICE int64_t size() const
DEVICE void setNull(int64_t index)
DEVICE bool isNull(int64_t index) const

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_make_polygon3__cpu_ ( TableFunctionManager mgr,
const Column< GeoLineString > &  rings,
const Column< GeoLineString > &  holes1,
const Column< GeoLineString > &  holes2,
Column< GeoPolygon > &  polygons,
Column< int > &  sizes 
)

Definition at line 129 of file GeoTestTableFunctions.cpp.

References flatbuffer::Column< RowType, RowStruct >::getNofValues(), flatbuffer::Column< RowType, RowStruct >::isNull(), parse_ast::line, TableFunctionManager::set_output_item_values_total_number(), TableFunctionManager::set_output_row_size(), Column< T >::setNull(), flatbuffer::Column< RowType, RowStruct >::setNull(), flatbuffer::Column< RowType, RowStruct >::size(), flatbuffer::NestedArray< ItemType >::size(), Geo::LineString::toCoords(), and toString().

134  {
135  auto size = rings.size();
137  0, rings.getNofValues() + holes1.getNofValues() + holes2.getNofValues());
138  mgr.set_output_row_size(size);
139  // Initialize polygons
140  int count_nulls = 0;
141  for (int64_t i = 0; i < size; i++) {
142  if (rings.isNull(i)) {
143  polygons.setNull(i);
144  sizes.setNull(i);
145  count_nulls++;
146  } else {
147  std::vector<std::vector<double>> polygon_coords;
148 
149  polygon_coords.push_back(rings[i].toCoords());
150  if (!holes1.isNull(i)) {
151  polygon_coords.push_back(holes1[i].toCoords());
152  if (!holes2.isNull(i)) {
153  polygon_coords.push_back(holes2[i].toCoords());
154  }
155  }
156 
157  auto polygon = polygons[i];
158  auto status = polygon.fromCoords(polygon_coords);
159 
160  if (status != FlatBufferManager::Status::Success) {
161  return mgr.ERROR_MESSAGE("fromCoords failed: " + ::toString(status));
162  }
163  int nofpoints = 0;
164  for (size_t j = 0; j < polygon.size(); j++) {
165  nofpoints += polygon.size(j);
166  }
167  sizes[i] = nofpoints;
168  }
169  }
170 
171  // Check polygons content
172  if (count_nulls == 0) {
173  return mgr.ERROR_MESSAGE("counting null test failed: count_nulls=" +
174  ::toString(count_nulls) + ", expected non-zero.");
175  }
176 
177  for (int64_t i = 0; i < size; i++) {
178  if (polygons.isNull(i)) {
179  count_nulls--;
180  } else {
181  std::vector<std::vector<double>> polygon_coords;
182  polygon_coords.push_back(rings[i].toCoords());
183  if (!holes1.isNull(i)) {
184  polygon_coords.push_back(holes1[i].toCoords());
185  }
186  if (!holes2.isNull(i)) {
187  polygon_coords.push_back(holes2[i].toCoords());
188  }
189 
190  // polygons[i] is Geo::Polygon instances
191  // polygons[i][j] is Geo::LineString instances
192  // polygons[i][j][k] is Geo::Point2D instances
193 
194  auto nof_lines = polygons[i].size();
195 
196  if (nof_lines != polygon_coords.size()) {
197  return mgr.ERROR_MESSAGE(
198  "polygon size test failed: nof_lines=" + ::toString(nof_lines) +
199  ", expected " + ::toString(polygon_coords.size()) + ".");
200  }
201  std::vector<std::vector<double>> poly_coords = polygons[i].toCoords();
202  if (nof_lines != poly_coords.size()) {
203  return mgr.ERROR_MESSAGE(
204  "polygon toCoords size test failed: poly_coords.size()=" +
205  ::toString(poly_coords.size()) + ", expected " + ::toString(nof_lines) + ".");
206  }
207 
208  auto poly = polygons[i];
209 
210  for (size_t j = 0; j < poly.size(); j++) {
211  Geo::LineString line = poly[j];
212  std::vector<double> line_coords = line.toCoords();
213  auto nof_points = polygon_coords[j].size() / 2;
214  if (poly.size(j) != nof_points) {
215  return mgr.ERROR_MESSAGE("polygon linestring size test failed: poly.size(" +
216  ::toString(j) + ")=" + ::toString(poly.size(j)) +
217  ", expected " + ::toString(nof_points) + ".");
218  }
219  if (line.size() != nof_points) {
220  return mgr.ERROR_MESSAGE("polygon linestring size test failed: line.size()=" +
221  ::toString(line.size()) + ", expected " +
222  ::toString(nof_points) + ".");
223  }
224  if (poly_coords[j].size() != nof_points * 2) {
225  return mgr.ERROR_MESSAGE(
226  "polygon linestring coords size test failed: poly_coords[j].size()=" +
227  ::toString(poly_coords[j].size()) + ", expected " +
228  ::toString(nof_points * 2) + ".");
229  }
230  if (line_coords.size() != nof_points * 2) {
231  return mgr.ERROR_MESSAGE(
232  "polygon linestring coords size test failed: line_coords.size()=" +
233  ::toString(line_coords.size()) + ", expected " +
234  ::toString(nof_points * 2) + ".");
235  }
236  for (size_t k = 0; k < nof_points; k++) {
237  if (std::abs(polygon_coords[j][2 * k] - line_coords[2 * k]) > 1e-7) {
238  return mgr.ERROR_MESSAGE(
239  "polygon linestring X coord test failed: line_coords[2*k]=" +
240  ::toString(line_coords[2 * k]) + ", expected " +
241  ::toString(polygon_coords[j][2 * k]) + ".");
242  }
243  if (std::abs(polygon_coords[j][2 * k] - poly_coords[j][2 * k]) > 1e-7) {
244  return mgr.ERROR_MESSAGE("polygon X coord test failed: poly_coords[j][2*k]=" +
245  ::toString(poly_coords[j][2 * k]) + ", expected " +
246  ::toString(polygon_coords[j][2 * k]) + ".");
247  }
248  if (std::abs(polygon_coords[j][2 * k] - line[k].x) > 1e-7) {
249  return mgr.ERROR_MESSAGE(
250  "polygon linestring X coord test failed: line[k].x=" +
251  ::toString(line[k].x) + ", expected " +
252  ::toString(polygon_coords[j][2 * k]) + ".");
253  }
254  if (std::abs(polygon_coords[j][2 * k + 1] - line_coords[2 * k + 1]) > 1e-7) {
255  return mgr.ERROR_MESSAGE(
256  "polygon linestring Y coord test failed: line_coords[2*k+1]=" +
257  ::toString(line_coords[2 * k + 1]) + ", expected " +
258  ::toString(polygon_coords[j][2 * k + 1]) + ".");
259  }
260  if (std::abs(polygon_coords[j][2 * k + 1] - poly_coords[j][2 * k + 1]) > 1e-7) {
261  return mgr.ERROR_MESSAGE(
262  "polygon Y coord test failed: poly_coords[j][2*k+1]=" +
263  ::toString(poly_coords[j][2 * k + 1]) + ", expected " +
264  ::toString(polygon_coords[j][2 * k + 1]) + ".");
265  }
266  if (std::abs(polygon_coords[j][2 * k + 1] - line[k].y) > 1e-7) {
267  return mgr.ERROR_MESSAGE(
268  "polygon linestring X coord test failed: line[k].y=" +
269  ::toString(line[k].y) + ", expected " +
270  ::toString(polygon_coords[j][2 * k + 1]) + ".");
271  }
272  }
273  }
274  }
275  }
276 
277  if (count_nulls != 0) {
278  return mgr.ERROR_MESSAGE("counting null test failed: count_nulls=" +
279  ::toString(count_nulls) + ", expected 0.");
280  }
281 
282  return size;
283 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
size_t size() const
std::vector< CT > toCoords() const
int64_t getNofValues() const
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703
DEVICE void setNull(int64_t index)
tuple line
Definition: parse_ast.py:10
void set_output_item_values_total_number(int32_t index, int64_t output_item_values_total_number)
Definition: heavydbTypes.h:367
DEVICE int64_t size() const
DEVICE void setNull(int64_t index)
DEVICE bool isNull(int64_t index) const

+ 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 100 of file SignatureTestTableFunctions.cpp.

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

101  {
102  T acc1 = 0, acc2 = 0;
103  for (int64_t i = 0; i < input.size(); i++) {
104  if (i % 2 == 0) {
105  acc1 += input[i];
106  } else {
107  acc2 += input[i];
108  }
109  }
110  out[0] = acc1;
111  out[1] = acc2;
112  return 2;
113 }
DEVICE int64_t size() const

+ 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 82 of file SignatureTestTableFunctions.cpp.

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

83  {
85  T acc = 0;
86  for (int64_t i = 0; i < input.size(); i++) {
87  acc += input[i];
88  }
89  out[0] = acc;
90  return 1;
91 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const

+ 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 144 of file SignatureTestTableFunctions.cpp.

References Column< T >::size().

146  {
147  for (int64_t j = 0; j < m; j++) {
148  for (int64_t i = 0; i < input.size(); i++) {
149  out[j * input.size() + i] += input[i];
150  }
151  }
152  return m * input.size();
153 }
DEVICE int64_t size() const

+ 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 121 of file SignatureTestTableFunctions.cpp.

References Column< T >::size().

123  {
124  for (int64_t i = 0; i < c; i++) {
125  out[i] = 0;
126  }
127  for (int64_t i = 0; i < input.size(); i++) {
128  out[i % c] += input[i];
129  }
130  return c;
131 }
DEVICE int64_t size() const

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_no_arg_constant_sizing ( Column< int32_t > &  answer)

Definition at line 182 of file SignatureTestTableFunctions.cpp.

182  {
183 #ifdef __CUDACC__
184  int32_t start = threadIdx.x + blockDim.x * blockIdx.x;
185  int32_t stop = static_cast<int32_t>(42);
186  int32_t step = blockDim.x * gridDim.x;
187 #else
188  auto start = 0;
189  auto stop = 42;
190  auto step = 1;
191 #endif
192  for (auto i = start; i < stop; i += step) {
193  answer[i] = 42 * i;
194  }
195  return 42;
196 }
template<typename T >
NEVER_INLINE HOST int32_t ct_no_arg_runtime_sizing__cpu_template ( Column< T > &  answer)

Definition at line 170 of file SignatureTestTableFunctions.cpp.

References set_output_row_size().

170  {
172  answer[0] = 42;
173  return 1;
174 }
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 247 of file SignatureTestTableFunctions.cpp.

249  {
250  for (int32_t i = 0; i < c; i++) {
251  output[i] = input_num;
252  }
253  return c;
254 }
template<typename T , typename K >
NEVER_INLINE HOST int32_t ct_overload_column_list_test2__cpu_template ( const Column< K > &  first_col,
const ColumnList< K > &  col_list1,
const ColumnList< T > &  col_list2,
const Column< T > &  last_col,
Column< K > &  out 
)

Definition at line 623 of file SignatureTestTableFunctions.cpp.

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

627  {
629  int64_t num_cols = col_list1.numCols();
630  K sum = 0;
631  for (int64_t i = 0; i < num_cols; ++i) {
632  const Column<K>& col = col_list1[i];
633  for (int64_t j = 0; j < col.size(); ++j) {
634  sum += col[j];
635  }
636  }
637 
638  int64_t num_cols2 = col_list2.numCols();
639  T sum2 = 0;
640  for (int64_t i = 0; i < num_cols2; ++i) {
641  const Column<T>& col = col_list2[i];
642  for (int64_t j = 0; j < col.size(); ++j) {
643  sum2 += col[j];
644  }
645  }
646 
647  if (sum + sum2 > 0) {
648  out[0] = first_col[0];
649  } else {
650  out[0] = last_col[0];
651  }
652  return 1;
653 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
DEVICE int64_t numCols() const

+ Here is the call graph for this function:

template<typename T , typename K >
NEVER_INLINE HOST int32_t ct_overload_column_list_test__cpu_template ( const Column< K > &  first_col,
const ColumnList< T > &  col_list,
const Column< K > &  last_col,
Column< K > &  out 
)

Definition at line 586 of file SignatureTestTableFunctions.cpp.

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

589  {
591  int64_t num_cols = col_list.numCols();
592  T sum = 0;
593  for (int64_t i = 0; i < num_cols; ++i) {
594  const Column<T>& col = col_list[i];
595  for (int64_t j = 0; j < col.size(); ++j) {
596  sum += col[j];
597  }
598  }
599  if (sum > 0) {
600  out[0] = first_col[0];
601  } else {
602  out[0] = last_col[0];
603  }
604  return 1;
605 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
DEVICE int64_t size() const
DEVICE int64_t numCols() const

+ Here is the call graph for this function:

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

Definition at line 548 of file SignatureTestTableFunctions.cpp.

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

549  {
550  int64_t size = input.size();
551  set_output_row_size(size);
552  for (int64_t i = 0; i < size; ++i) {
553  if (input.isNull(i)) {
554  out.setNull(i);
555  } else {
556  out[i] = input[i];
557  }
558  }
559  return size;
560 }
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<typename T >
NEVER_INLINE HOST int32_t ct_overload_scalar_test__cpu_template ( const T  scalar,
Column< T > &  out 
)

Definition at line 527 of file SignatureTestTableFunctions.cpp.

References set_output_row_size().

528  {
530  if constexpr (std::is_same<T, int64_t>::value) {
531  out[0] = scalar;
532  } else if constexpr (std::is_same<T, Timestamp>::value) {
533  out[0] = scalar.time;
534  }
535  return 1;
536 }
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_pointn__cpu_template ( TableFunctionManager mgr,
const Column< T > &  points,
int64_t  n,
Column< double > &  xcoords,
Column< double > &  ycoords 
)

Definition at line 68 of file GeoTestTableFunctions.cpp.

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

72  {
73  auto size = points.size();
74  mgr.set_output_row_size(size);
75  for (int64_t i = 0; i < size; i++) {
76  if (points.isNull(i)) {
77  xcoords.setNull(i);
78  ycoords.setNull(i);
79  } else {
80  const auto point = points[i][n - 1]; // n is one-based
81  xcoords[i] = point.x;
82  ycoords[i] = point.y;
83  }
84  }
85  return size;
86 }
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)
constexpr double n
Definition: Utm.h:38

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_polygonn__cpu_ ( TableFunctionManager mgr,
const Column< GeoMultiPolygon > &  mpolygons,
int64_t  n,
Column< GeoPolygon > &  polygons 
)

Definition at line 459 of file GeoTestTableFunctions.cpp.

References flatbuffer::Column< RowType, RowStruct >::getNofValues(), flatbuffer::Column< RowType, RowStruct >::isNull(), TableFunctionManager::set_output_item_values_total_number(), TableFunctionManager::set_output_row_size(), flatbuffer::Column< RowType, RowStruct >::setItem(), flatbuffer::Column< RowType, RowStruct >::setNull(), and flatbuffer::Column< RowType, RowStruct >::size().

462  {
463  auto size = mpolygons.size();
465  mgr.set_output_row_size(size);
466  for (int64_t i = 0; i < size; i++) {
467  if (mpolygons.isNull(i)) {
468  polygons.setNull(i);
469  } else {
470  polygons.setItem(i, mpolygons[i][n - 1]);
471  }
472  }
473  return size;
474 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
int64_t getNofValues() const
void set_output_item_values_total_number(int32_t index, int64_t output_item_values_total_number)
Definition: heavydbTypes.h:367
DEVICE int64_t size() const
DEVICE void setNull(int64_t index)
DEVICE bool isNull(int64_t index) const
constexpr double n
Definition: Utm.h:38
DEVICE void setItem(int64_t index, const RowType &item)

+ Here is the call graph for this function:

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 84 of file FilterPushdownTestTableFunctions.cpp.

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

92  {
93  const int64_t input_size = input_id.size();
94  mgr.set_output_row_size(input_size);
95  for (int64_t input_idx = 0; input_idx < input_size; ++input_idx) {
96  output_id[input_idx] = input_id[input_idx];
97  output_x[input_idx] = input_x[input_idx];
98  output_y[input_idx] = input_y[input_idx];
99  output_z[input_idx] = input_z[input_idx];
100  }
101  return input_size;
102 }
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 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 61 of file FilterPushdownTestTableFunctions.cpp.

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

71  {
72  const std::string agg_type_str = agg_type.getString();
73  const TFAggType min_or_max = agg_type_str == "MIN" ? TFAggType::MIN : TFAggType::MAX;
74  mgr.set_output_row_size(1);
75  output_row_count[0] = input_id.size();
76  output_id[0] = get_min_or_max(input_id, min_or_max);
77  output_x[0] = get_min_or_max(input_x, min_or_max);
78  output_y[0] = get_min_or_max(input_y, min_or_max);
79  output_z[0] = get_min_or_max(input_z, min_or_max);
80  return 1;
81 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
std::string getString() const
Definition: heavydbTypes.h:641
DEVICE int64_t size() const
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 326 of file SignatureTestTableFunctions.cpp.

References set_output_row_size().

328  {
330  out[0] = 3;
331  return 1;
332 }
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 374 of file SignatureTestTableFunctions.cpp.

References set_output_row_size().

376  {
378  out[0] = 7;
379  return 1;
380 }
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_cursor__cpu_ ( const Column< int64_t > &  input,
int64_t  y,
Column< int64_t > &  out 
)

Definition at line 416 of file SignatureTestTableFunctions.cpp.

References set_output_row_size().

418  {
420  out[0] = 12;
421  return 1;
422 }
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 342 of file SignatureTestTableFunctions.cpp.

References set_output_row_size().

345  {
347  out[0] = 4;
348  return 1;
349 }
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 382 of file SignatureTestTableFunctions.cpp.

References set_output_row_size().

384  {
386  out[0] = 8;
387  return 1;
388 }
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_require_range__cpu_ ( const Column< int32_t > &  input1,
const int32_t  x,
const int32_t  multiplier,
Column< int32_t > &  out 
)

Definition at line 672 of file SignatureTestTableFunctions.cpp.

675  {
676  out[0] = 0;
677  return 1;
678 }
EXTENSION_NOINLINE_HOST int32_t ct_require_str__cpu_ ( const Column< int32_t > &  input1,
const TextEncodingNone s,
Column< int32_t > &  out 
)

Definition at line 334 of file SignatureTestTableFunctions.cpp.

References set_output_row_size().

336  {
338  out[0] = 3;
339  return 1;
340 }
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 390 of file SignatureTestTableFunctions.cpp.

References set_output_row_size().

392  {
394  out[0] = 9;
395  return 1;
396 }
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 352 of file SignatureTestTableFunctions.cpp.

References set_output_row_size().

354  {
356  if constexpr (std::is_same<T, int32_t>::value) {
357  out[0] = 5;
358  } else if constexpr (std::is_same<T, double>::value) {
359  out[0] = 6.0;
360  }
361  return 1;
362 }
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_collist_enc_dict__cpu_ ( const ColumnList< TextEncodingDict > &  input,
const int64_t  x,
Column< int64_t > &  out 
)

Definition at line 408 of file SignatureTestTableFunctions.cpp.

References set_output_row_size().

410  {
412  out[0] = 11;
413  return 1;
414 }
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 399 of file SignatureTestTableFunctions.cpp.

References set_output_row_size().

401  {
403  out[0] = 10;
404  return 1;
405 }
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 202 of file SignatureTestTableFunctions.cpp.

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

202  {
203  T quotient = num;
205  int32_t counter{0};
206  while (quotient >= 1) {
207  answer[counter++] = quotient;
208  quotient /= 10;
209  }
210  return counter;
211 }
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 224 of file SignatureTestTableFunctions.cpp.

227  {
228 #ifdef __CUDACC__
229  int32_t start = threadIdx.x + blockDim.x * blockIdx.x;
230  int32_t stop = static_cast<int32_t>(5);
231  int32_t step = blockDim.x * gridDim.x;
232 #else
233  auto start = 0;
234  auto stop = 5;
235  auto step = 1;
236 #endif
237  for (auto i = start; i < stop; i += step) {
238  answer1[i] = num1 + i * num2;
239  answer2[i] = num1 - i * num2;
240  }
241  return 5;
242 }
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 496 of file SignatureTestTableFunctions.cpp.

References TableFunctionManager::set_output_row_size().

500  {
501  mgr.set_output_row_size(1);
502  out1[0] = arg1;
503  out2[0] = arg2;
504  return 1;
505 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_shift__cpu_ ( TableFunctionManager mgr,
const Column< GeoPoint > &  points,
const double  x,
const double  y,
Column< GeoPoint > &  shifted_points 
)

Definition at line 47 of file GeoTestTableFunctions.cpp.

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

51  {
52  auto size = points.size();
53  mgr.set_output_row_size(size);
54  for (int64_t i = 0; i < size; i++) {
55  if (points.isNull(i)) {
56  shifted_points.setNull(i);
57  } else {
58  auto point = points[i];
59  point.x += x;
60  point.y += y;
61  shifted_points.setItem(i, point);
62  }
63  }
64  return size;
65 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const
DEVICE void setNull(int64_t index)
DEVICE bool isNull(int64_t index) const
DEVICE void setItem(int64_t index, const Geo::Point2D &other)

+ 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 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_HOST int32_t ct_string_concat__cpu_ ( TableFunctionManager mgr,
const ColumnList< TextEncodingDict > &  input_strings,
const TextEncodingNone separator,
Column< TextEncodingDict > &  concatted_string 
)

Definition at line 85 of file StringTestTableFunctions.cpp.

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

88  {
89  const int64_t num_rows = input_strings.size();
90  const int64_t num_cols = input_strings.numCols();
91  const std::string separator_str{separator.getString()};
92  mgr.set_output_row_size(num_rows);
93  for (int64_t row_idx = 0; row_idx < num_rows; row_idx++) {
94  if (num_cols > 0) {
95  std::string concatted_output{input_strings[0].getString(row_idx)};
96  for (int64_t col_idx = 1; col_idx < num_cols; ++col_idx) {
97  concatted_output += separator_str;
98  concatted_output += input_strings[col_idx].getString(row_idx);
99  }
100  const TextEncodingDict concatted_str_id =
101  concatted_string.getOrAddTransient(concatted_output);
102  concatted_string[row_idx] = concatted_str_id;
103  } else {
104  concatted_string.setNull(row_idx);
105  }
106  }
107  return num_rows;
108 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
std::string getString() const
Definition: heavydbTypes.h:641
DEVICE int64_t size() const
DEVICE void setNull(int64_t index)
DEVICE int64_t numCols() const
DEVICE const TextEncodingDict getOrAddTransient(const std::string &str)

+ 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 200 of file StringTestTableFunctions.cpp.

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

202  {
203  const std::string str{input.getString()};
204  const int64_t str_size(str.size());
205  set_output_row_size(str_size);
206  for (int32_t i = 0; i < str_size; ++i) {
207  char_idx[i] = i;
208  char_bytes[i] = str[i];
209  }
210  return str_size;
211 }
EXTENSION_NOINLINE_HOST void set_output_row_size(int64_t num_rows)
std::string getString() const
Definition: heavydbTypes.h:641

+ 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 68 of file StringTestTableFunctions.cpp.

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

72  {
73  const int64_t num_rows = input_str.size();
74  mgr.set_output_row_size(num_rows);
75  for (int64_t row_idx = 0; row_idx < num_rows; row_idx++) {
76  const std::string input_string{input_str.getString(row_idx)};
77  const std::string substring = input_string.substr(pos[row_idx], len[row_idx]);
78  const TextEncodingDict substr_id = output_substr.getOrAddTransient(substring);
79  output_substr[row_idx] = substr_id;
80  }
81  return num_rows;
82 }
DEVICE const std::string getString(int64_t index) const
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const
DEVICE const TextEncodingDict getOrAddTransient(const std::string &str)
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 111 of file StringTestTableFunctions.cpp.

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

113  {
114  mgr.set_output_row_size(num_strings);
115  for (int32_t s = 0; s < num_strings; ++s) {
116  const std::string new_string = "String_" + std::to_string(s);
117  const int32_t string_id = new_dict_col.getOrAddTransient(new_string);
118  new_dict_col[s] = string_id;
119  }
120  return num_strings;
121 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
std::string to_string(char const *&&v)
DEVICE const TextEncodingDict getOrAddTransient(const std::string &str)

+ 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 262 of file SignatureTestTableFunctions.cpp.

264  {
265  for (int32_t i = 0; i < c; i++) {
266  output[i] = input_num;
267  }
268  return c;
269 }
EXTENSION_NOINLINE_HOST int32_t ct_test_allocator ( TableFunctionManager mgr,
const Column< int32_t > &  input,
const TextEncodingNone t,
Column< int32_t > &  out 
)

Definition at line 424 of file SignatureTestTableFunctions.cpp.

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

427  {
429  mgr.set_output_row_size(1);
430  TextEncodingNone t2(mgr, t.getString());
431  out[0] = 11;
432  return 1;
433 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
std::string getString() const
Definition: heavydbTypes.h:641
void enable_output_allocations()
Definition: heavydbTypes.h:381

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_test_calcite_casting_bigint__cpu_ ( TableFunctionManager mgr,
const Column< int64_t > &  input1,
Column< int64_t > &  out 
)

Definition at line 776 of file SignatureTestTableFunctions.cpp.

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

778  {
779  int32_t size = input1.size();
780  mgr.set_output_row_size(size);
781  for (int i = 0; i < size; ++i) {
782  out[i] = input1[i];
783  }
784  return size;
785 }
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_calcite_casting_char__cpu_ ( TableFunctionManager mgr,
const Column< TextEncodingDict > &  input1,
Column< TextEncodingDict > &  out 
)

Definition at line 764 of file SignatureTestTableFunctions.cpp.

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

766  {
767  int32_t size = input1.size();
768  mgr.set_output_row_size(size);
769  for (int i = 0; i < size; ++i) {
770  out[i] = input1[i];
771  }
772  return size;
773 }
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 >
TEMPLATE_NOINLINE int32_t ct_test_calcite_casting_columnlist__template_cpu_ ( TableFunctionManager mgr,
const Column< T > &  first,
const ColumnList< T > &  list,
Column< T > &  out 
)

Definition at line 813 of file SignatureTestTableFunctions.cpp.

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

816  {
817  mgr.set_output_row_size(list.numCols() + 1);
818  out[0] = first[0];
819  for (int i = 0; i < list.numCols(); i++) {
820  out[i + 1] = list[i][0];
821  }
822  return out.size();
823 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const
DEVICE int64_t numCols() const

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_test_calcite_casting_double__cpu_ ( TableFunctionManager mgr,
const Column< double > &  input1,
Column< double > &  out 
)

Definition at line 788 of file SignatureTestTableFunctions.cpp.

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

790  {
791  int32_t size = input1.size();
792  mgr.set_output_row_size(size);
793  for (int i = 0; i < size; ++i) {
794  out[i] = input1[i];
795  }
796  return size;
797 }
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_calcite_casting_timestamp__cpu_ ( TableFunctionManager mgr,
const Column< Timestamp > &  input1,
Column< Timestamp > &  out 
)

Definition at line 800 of file SignatureTestTableFunctions.cpp.

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

802  {
803  int32_t size = input1.size();
804  mgr.set_output_row_size(size);
805  for (int i = 0; i < size; ++i) {
806  out[i] = input1[i];
807  }
808  return size;
809 }
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 >
TEMPLATE_NOINLINE int32_t ct_test_float_default_arg__template ( const Column< T > &  inp,
const T  x,
const int32_t  multiplier,
Column< T > &  out 
)

Definition at line 719 of file SignatureTestTableFunctions.cpp.

References Column< T >::size().

722  {
723  int32_t size = inp.size();
724  for (int i = 0; i < size; ++i) {
725  out[i] = inp[i] / x;
726  }
727 
728  return size;
729 }
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 }
template<typename T >
TEMPLATE_NOINLINE int32_t ct_test_int_default_arg__template ( const Column< T > &  inp,
const T  x,
const int32_t  multiplier,
Column< T > &  out 
)

Definition at line 681 of file SignatureTestTableFunctions.cpp.

References Column< T >::size().

684  {
685  int32_t size = inp.size();
686  for (int i = 0; i < size; ++i) {
687  out[i] = inp[i] * x;
688  }
689 
690  return size;
691 }
DEVICE int64_t size() const

+ Here is the call graph for this function:

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:

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 482 of file SignatureTestTableFunctions.cpp.

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

487  {
488  mgr.set_output_row_size(lst.numCols() + 1);
489  out[0] = col[1];
490  for (int i = 0; i < lst.numCols(); i++) {
491  out[i + 1] = lst[i][1];
492  }
493  return out.size();
494 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const
DEVICE int64_t numCols() const

+ 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 467 of file SignatureTestTableFunctions.cpp.

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

472  {
473  mgr.set_output_row_size(lst.numCols() + 1);
474  out[0] = col[0];
475  for (int i = 0; i < lst.numCols(); i++) {
476  out[i + 1] = lst[i][0];
477  }
478  return out.size();
479 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const
DEVICE int64_t numCols() const

+ 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 448 of file SignatureTestTableFunctions.cpp.

References Column< T >::size().

451  {
452  out[0] = 123;
453  out[1] = 456;
454  return out.size();
455 }
DEVICE int64_t size() const

+ 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 457 of file SignatureTestTableFunctions.cpp.

References Column< T >::size().

458  {
459  out[0] = 789;
460  out[1] = 321;
461  return out.size();
462 }
DEVICE int64_t size() const

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_test_string_default_arg__cpu_ ( TableFunctionManager mgr,
const Column< TextEncodingDict > &  inp,
const TextEncodingNone suffix,
Column< TextEncodingDict > &  out 
)

Definition at line 747 of file SignatureTestTableFunctions.cpp.

References Column< TextEncodingDict >::getOrAddTransient(), TextEncodingNone::getString(), Column< TextEncodingDict >::getString(), TableFunctionManager::set_output_row_size(), and Column< TextEncodingDict >::size().

750  {
751  int32_t size = inp.size();
752  mgr.set_output_row_size(size);
753  for (int i = 0; i < size; ++i) {
754  std::string output_string = inp.getString(i);
755  output_string += suffix.getString();
756  const TextEncodingDict concatted_id = out.getOrAddTransient(output_string);
757  out[i] = concatted_id;
758  }
759 
760  return size;
761 }
DEVICE const std::string getString(int64_t index) const
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
std::string getString() const
Definition: heavydbTypes.h:641
DEVICE int64_t size() const
DEVICE const TextEncodingDict getOrAddTransient(const std::string &str)

+ 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<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:

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 int32_t ct_to_multilinestring__cpu_ ( TableFunctionManager mgr,
const Column< GeoPolygon > &  polygons,
Column< GeoMultiLineString > &  mlinestrings 
)

Definition at line 477 of file GeoTestTableFunctions.cpp.

References flatbuffer::Column< RowType, RowStruct >::getNofValues(), flatbuffer::Column< RowType, RowStruct >::isNull(), TableFunctionManager::set_output_item_values_total_number(), TableFunctionManager::set_output_row_size(), flatbuffer::Column< RowType, RowStruct >::setNull(), flatbuffer::Column< RowType, RowStruct >::size(), and toString().

479  {
480  auto size = polygons.size();
482  mgr.set_output_row_size(size);
483  // Initialize mlinestrings
484  int count_nulls = 0;
485  FlatBufferManager::Status status{};
486  for (int64_t i = 0; i < size; i++) {
487  if (polygons.isNull(i)) {
488  mlinestrings.setNull(i);
489  count_nulls++;
490  } else {
491  std::vector<std::vector<double>> polygon_coords = polygons[i].toCoords();
492  status = mlinestrings[i].fromCoords(polygon_coords);
493  if (status != FlatBufferManager::Status::Success) {
494  return mgr.ERROR_MESSAGE("fromCoords failed: " + ::toString(status));
495  }
496  }
497  }
498  return size;
499 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
int64_t getNofValues() const
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703
void set_output_item_values_total_number(int32_t index, int64_t output_item_values_total_number)
Definition: heavydbTypes.h:367
DEVICE int64_t size() const
DEVICE void setNull(int64_t index)
DEVICE bool isNull(int64_t index) const

+ Here is the call graph for this function:

EXTENSION_NOINLINE int32_t ct_to_polygon__cpu_ ( TableFunctionManager mgr,
const Column< GeoMultiLineString > &  mlinestrings,
Column< GeoPolygon > &  polygons 
)

Definition at line 502 of file GeoTestTableFunctions.cpp.

References flatbuffer::Column< RowType, RowStruct >::getNofValues(), flatbuffer::Column< RowType, RowStruct >::isNull(), TableFunctionManager::set_output_item_values_total_number(), TableFunctionManager::set_output_row_size(), flatbuffer::Column< RowType, RowStruct >::setNull(), flatbuffer::Column< RowType, RowStruct >::size(), and toString().

504  {
505  auto size = mlinestrings.size();
506  mgr.set_output_item_values_total_number(0, mlinestrings.getNofValues());
507  mgr.set_output_row_size(size);
508  // Initialize polygons
509  int count_nulls = 0;
510  FlatBufferManager::Status status{};
511  for (int64_t i = 0; i < size; i++) {
512  if (mlinestrings.isNull(i)) {
513  polygons.setNull(i);
514  count_nulls++;
515  } else {
516  std::vector<std::vector<double>> polygon_coords;
517  status = mlinestrings[i].toCoords(polygon_coords);
518  if (status != FlatBufferManager::Status::Success) {
519  return mgr.ERROR_MESSAGE("toCoords failed: " + ::toString(status));
520  }
521  status = polygons[i].fromCoords(polygon_coords);
522  if (status != FlatBufferManager::Status::Success) {
523  return mgr.ERROR_MESSAGE("fromCoords failed: " + ::toString(status));
524  }
525  }
526  }
527  return size;
528 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
int64_t getNofValues() const
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703
void set_output_item_values_total_number(int32_t index, int64_t output_item_values_total_number)
Definition: heavydbTypes.h:367
DEVICE int64_t size() const
DEVICE void setNull(int64_t index)
DEVICE bool isNull(int64_t index) const

+ 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 273 of file RbcTestTableFunctions.cpp.

275  {
276  out[0] = 1000 + 1 + 10 * multiplier;
277  return 1;
278 }
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 280 of file RbcTestTableFunctions.cpp.

283  {
284  out[0] = 1000 + 2 + 11 * multiplier;
285  return 1;
286 }
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 288 of file RbcTestTableFunctions.cpp.

294  {
295  out[0] = 1000 + 101 + 10 * multiplier + x;
296  return 1;
297 }
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 299 of file RbcTestTableFunctions.cpp.

302  {
303  out[0] = 1000 + 99 + 10 * multiplier + x;
304  return 1;
305 }
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 307 of file RbcTestTableFunctions.cpp.

310  {
311  out[0] = 1000 + 98 + multiplier + 10 * x;
312  return 1;
313 }
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 315 of file RbcTestTableFunctions.cpp.

318  {
319  out[0] = 1000 + 2 + multiplier;
320  return 1;
321 }
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 323 of file RbcTestTableFunctions.cpp.

326  {
327  out[0] = 1000 + 99 + multiplier + 11 * x;
328  return 1;
329 }
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 331 of file RbcTestTableFunctions.cpp.

334  {
335  out[0] = 1000 + 98 + 100 * multiplier + x;
336  return 1;
337 }
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 339 of file RbcTestTableFunctions.cpp.

343  {
344  out[0] = 1000 + 99 + 100 * multiplier + x;
345  return 1;
346 }
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 348 of file RbcTestTableFunctions.cpp.

352  {
353  out[0] = 1000 + 99 + 10 * multiplier + x;
354  return 1;
355 }
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 357 of file RbcTestTableFunctions.cpp.

360  {
361  out[0] = 1000 + 99 + 9 * multiplier + x;
362  return 1;
363 }
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 142 of file FilterPushdownTestTableFunctions.cpp.

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

156  {
157  const int64_t input1_size = input1_id.size();
158  const int64_t input2_size = input2_id.size();
159  int64_t output_size = input1_size + input2_size;
160  mgr.set_output_row_size(output_size);
161  for (int64_t input1_idx = 0; input1_idx < input1_size; ++input1_idx) {
162  output_id[input1_idx] = input1_id[input1_idx];
163  output_x[input1_idx] = input1_x[input1_idx];
164  output_y[input1_idx] = input1_y[input1_idx];
165  output_z[input1_idx] = input1_z[input1_idx];
166  output_w.setNull(input1_idx);
167  }
168  for (int64_t input2_idx = 0; input2_idx < input2_size; ++input2_idx) {
169  output_id[input1_size + input2_idx] = input2_id[input2_idx];
170  output_x[input1_size + input2_idx] = input2_x[input2_idx];
171  output_y[input1_size + input2_idx] = input2_y[input2_idx];
172  output_z[input1_size + input2_idx] = input2_z[input2_idx];
173  output_w[input1_size + input2_idx] = input2_w[input2_idx];
174  }
175  return output_size;
176 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
DEVICE int64_t size() const
DEVICE void setNull(int64_t index)

+ 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 106 of file FilterPushdownTestTableFunctions.cpp.

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().

122  {
123  mgr.set_output_row_size(1);
124  const std::string agg_type_str = agg_type.getString();
125  const TFAggType min_or_max = agg_type_str == "MIN" ? TFAggType::MIN : TFAggType::MAX;
126  output_row_count[0] = input1_id.size() + input2_id.size();
127  output_id[0] = get_min_or_max_union(input1_id, input2_id, min_or_max);
128  output_x[0] = get_min_or_max_union(input1_x, input2_x, min_or_max);
129  output_y[0] = get_min_or_max_union(input1_y, input2_y, min_or_max);
130  output_z[0] = get_min_or_max_union(input1_z, input2_z, min_or_max);
131  if (input2_w.size() > 0) {
132  const auto w_min_max = get_column_min_max(input2_w);
133  output_w[0] = agg_type_str == "MIN" ? w_min_max.first : w_min_max.second;
134  } else {
135  output_w.setNull(0);
136  }
137  return 1;
138 }
void set_output_row_size(int64_t num_rows)
Definition: heavydbTypes.h:373
std::string getString() const
Definition: heavydbTypes.h:641
NEVER_INLINE HOST std::pair< T, T > get_column_min_max(const Column< T > &col)
DEVICE int64_t size() const
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)

+ 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<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<typename T >
NEVER_INLINE HOST int32_t sum_along_row__cpu_template ( const Column< Array< T >> &  input,
Column< T > &  output 
)

Definition at line 29 of file ArrayTestTableFunctions.cpp.

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

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

+ Here is the call graph for this function:

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: