amorynan commented on code in PR #20928: URL: https://github.com/apache/doris/pull/20928#discussion_r1233465094
########## be/src/vec/data_types/serde/data_type_struct_serde.cpp: ########## @@ -56,48 +56,64 @@ void DataTypeStructSerDe::read_column_from_arrow(IColumn& column, const arrow::A const cctz::time_zone& ctz) const { LOG(FATAL) << "Not support read " << column.get_name() << " from arrow"; } + template <bool is_binary_format> -Status DataTypeStructSerDe::_write_column_to_mysql( - const IColumn& column, bool return_object_data_as_binary, - std::vector<MysqlRowBuffer<is_binary_format>>& result, int row_idx, int start, int end, - bool col_const) const { - int buf_ret = 0; +Status DataTypeStructSerDe::_write_column_to_mysql(const IColumn& column, + MysqlRowBuffer<is_binary_format>& result, + int row_idx, bool col_const) const { auto& col = assert_cast<const ColumnStruct&>(column); - for (ssize_t i = start; i < end; ++i) { - if (0 != buf_ret) { - return Status::InternalError("pack mysql buffer failed."); - } - const auto col_index = index_check_const(i, col_const); - result[row_idx].open_dynamic_mode(); - buf_ret = result[row_idx].push_string("{", 1); - bool begin = true; - for (size_t j = 0; j < elemSerDeSPtrs.size(); ++j) { - if (!begin) { - buf_ret = result[row_idx].push_string(", ", 2); + const auto col_index = index_check_const(row_idx, col_const); + result.open_dynamic_mode(); + if (0 != result.push_string("{", 1)) { Review Comment: UNLIKELY If -- 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