31 int size = input.size();
32 for (
int i = 0; i < size; i++) {
37 if constexpr (std::is_same<T, TextEncodingDict>::value) {
40 for (
size_t j = 0; j < arr.
size(); j++) {
42 acc += mgr->getString(input.getDictDbId(), input.getDictId(), arr[j]);
45 int32_t out_string_id =
46 mgr->getOrAddTransient(output.getDictDbId(), output.getDictId(), acc);
47 output[i] = out_string_id;
50 for (
size_t j = 0; j < arr.
size(); j++) {
51 if constexpr (std::is_same_v<T, bool>) {
92 int size = input.size();
95 int output_values_size = 0;
96 for (
int i = 0; i < size; i++) {
97 output_values_size += input[i].size();
107 for (
int i = 0; i < size; i++) {
108 output.setItem(i, input[i]);
148 template <
typename T>
152 int size = inputs.size();
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();
166 for (
int i = 0; i < size; i++) {
167 for (
int j = 0; j < inputs.numCols(); j++) {
176 template <
typename T>
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();
192 for (
int i = 0; i < size; i++) {
193 output.concatItem(i, input1[i]);
194 output.concatItem(i, input2);
269 template <
typename T>
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);
283 if constexpr (std::is_same<T, TextEncodingDict>::value) {
284 for (
int i = 0; i < size; i++) {
288 Array<T> arr = output.getItem(i, 1);
292 mgr.
getString(input.getDictDbId(), input.getDictId(), input[i]));
296 for (
int i = 0; i < size; i++) {
300 Array<T> arr = output.getItem(i, 1);
327 template <
typename T>
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;
346 for (
int i = 0; i < size; i++) {
347 if (input.isNull(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++) {
359 arr2[j - sz / 2] = arr[j];
417 #endif // #ifndef __CUDACC__
void set_output_row_size(int64_t num_rows)
std::string getString(int32_t db_id, int32_t dict_id, int32_t string_id)
void set_output_array_values_total_number(int32_t index, int64_t output_array_values_total_number)
NEVER_INLINE HOST int32_t array_copier__cpu_template(TableFunctionManager &mgr, const Column< Array< T >> &input, Column< Array< T >> &output)
int32_t getOrAddTransient(int32_t db_id, int32_t dict_id, std::string str)
NEVER_INLINE HOST int32_t array_asarray__cpu_template(TableFunctionManager &mgr, const Column< T > &input, Column< Array< T >> &output)
DEVICE int64_t size() const
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 array_concat__cpu_template(TableFunctionManager &mgr, const ColumnList< Array< T >> &inputs, Column< Array< T >> &output)
NEVER_INLINE HOST int32_t sum_along_row__cpu_template(const Column< Array< T >> &input, Column< T > &output)
DEVICE bool isNull(int64_t index) const
DEVICE void setNull(int64_t index)
DEVICE ALWAYS_INLINE size_t size() const
NEVER_INLINE HOST int32_t array_append__cpu_template(TableFunctionManager &mgr, const Column< Array< T >> &input1, const Array< T > &input2, Column< Array< T >> &output)
static TableFunctionManager * get_singleton()
DEVICE bool isNull() const