HappenLee commented on code in PR #31913:
URL: https://github.com/apache/doris/pull/31913#discussion_r1527973432
##########
be/src/vec/aggregate_functions/aggregate_function_collect.h:
##########
@@ -417,6 +465,49 @@ struct AggregateFunctionArrayAggData<StringRef> {
}
to_arr.get_offsets().push_back(to_nested_col.size());
}
+
+ void write(BufferWritable& buf) const {
+ const size_t size = null_map->size();
+ write_binary(size, buf);
+ for (size_t i = 0; i < size; i++) {
+ write_binary(null_map->data()[i], buf);
+ }
+ for (size_t i = 0; i < size; i++) {
+ write_string_binary(nested_column->get_data_at(i), buf);
+ }
+ }
+ void read(BufferReadable& buf) {
+ DCHECK(null_map);
+ DCHECK(null_map->empty());
+ size_t size = 0;
+ read_binary(size, buf);
+ null_map->reserve(size);
+ nested_column->reserve(size);
+
+ NullMap::value_type null_value;
+ for (size_t i = 0; i < size; i++) {
+ read_binary(null_value, buf);
+ null_map->push_back(null_value);
+ }
+
+ std::string s;
Review Comment:
better use `StringRef ` to reduce the memcpy
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]