zxealous commented on code in PR #10749: URL: https://github.com/apache/doris/pull/10749#discussion_r918507313
########## be/src/vec/functions/function_string.h: ########## @@ -553,20 +563,123 @@ class FunctionStringConcatWs : public IFunction { fmt::memory_buffer buffer; std::vector<std::string_view> views; + if (check_column<ColumnArray>(argument_columns[1].get())) { + // Determine if the nested type of the array is String + const ColumnArray& array_column = + reinterpret_cast<const ColumnArray&>(*argument_columns[1]); + if (!array_column.get_data().is_column_string()) { + return Status::NotSupported( + fmt::format("unsupported nested array of type {} for function {}", + array_column.get_data().get_family_name(), get_name())); + } + // Concat string in array + _execute_array(input_rows_count, array_column, buffer, views, offsets_list, chars_list, + null_list, res_data, res_offset); + + } else { + // Concat string + _execute_string(input_rows_count, argument_size, buffer, views, offsets_list, + chars_list, null_list, res_data, res_offset); + } + if (is_null_type) { + block.get_by_position(result).column = + ColumnNullable::create(std::move(res), std::move(null_map)); + } else { + block.get_by_position(result).column = std::move(res); + } + return Status::OK(); + } + +private: + void _execute_array(const size_t& input_rows_count, const ColumnArray& array_column, + fmt::memory_buffer& buffer, std::vector<std::string_view>& views, + const std::vector<const ColumnString::Offsets*>& offsets_list, Review Comment: done ########## be/src/vec/functions/function_string.h: ########## @@ -553,20 +563,123 @@ class FunctionStringConcatWs : public IFunction { fmt::memory_buffer buffer; std::vector<std::string_view> views; + if (check_column<ColumnArray>(argument_columns[1].get())) { + // Determine if the nested type of the array is String + const ColumnArray& array_column = + reinterpret_cast<const ColumnArray&>(*argument_columns[1]); + if (!array_column.get_data().is_column_string()) { + return Status::NotSupported( + fmt::format("unsupported nested array of type {} for function {}", + array_column.get_data().get_family_name(), get_name())); + } + // Concat string in array + _execute_array(input_rows_count, array_column, buffer, views, offsets_list, chars_list, + null_list, res_data, res_offset); + + } else { + // Concat string + _execute_string(input_rows_count, argument_size, buffer, views, offsets_list, + chars_list, null_list, res_data, res_offset); + } + if (is_null_type) { + block.get_by_position(result).column = + ColumnNullable::create(std::move(res), std::move(null_map)); + } else { + block.get_by_position(result).column = std::move(res); + } + return Status::OK(); + } + +private: + void _execute_array(const size_t& input_rows_count, const ColumnArray& array_column, + fmt::memory_buffer& buffer, std::vector<std::string_view>& views, + const std::vector<const ColumnString::Offsets*>& offsets_list, + const std::vector<const ColumnString::Chars*>& chars_list, Review Comment: done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org