HappenLee commented on code in PR #18310: URL: https://github.com/apache/doris/pull/18310#discussion_r1156865089
########## be/src/vec/functions/array/function_array_set.h: ########## @@ -216,6 +213,88 @@ struct ArraySetImpl { } return true; } + template <typename ColumnType> + static bool _execute_internal_lconst(ColumnArrayMutableData& dst, + const ColumnArrayExecutionData& left_data, + const ColumnArrayExecutionData& right_data) { + using Impl = OpenSetImpl<operation, ColumnType>; + if (!check_column<ColumnType>(*left_data.nested_col)) { + return false; + } + constexpr auto execute_left_column_first = Impl::Action::execute_left_column_first; + size_t current = 0; + Impl impl; + size_t left_off = (*left_data.offsets_ptr)[-1]; + size_t left_len = (*left_data.offsets_ptr)[0] - left_off; + for (size_t row = 0; row < left_data.offsets_ptr->size(); ++row) { + size_t count = 0; + size_t right_off = (*right_data.offsets_ptr)[row - 1]; + size_t right_len = (*right_data.offsets_ptr)[row] - right_off; + if constexpr (execute_left_column_first) { Review Comment: ``` if constexpr (execute_left_column_first) { impl.template apply<true>(left_data, left_off, left_len, dst, &count); impl.template apply<false>(right_data, right_off, right_len, dst, &count); } else { impl.template apply<false>(right_data, right_off, right_len, dst, &count); impl.template apply<true>(left_data, left_off, left_len, dst, &count); } current += count; dst.offsets_ptr->push_back(current); impl.reset(); ``` the code better be a template func -- 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