mrhhsg commented on code in PR #68426:
URL: https://github.com/apache/doris/pull/68426#discussion_r4208070496


##########
be/src/exprs/aggregate/aggregate_function_map_v2.h:
##########
@@ -119,50 +124,51 @@ struct AggregateFunctionMapAggDataV2 {
     }
 
     void write(BufferWritable& buf) const {
-        auto serialized_bytes =
-                _key_type->get_uncompressed_serialized_bytes(*_key_column, 
_be_version);
-
-        std::string serialized_buffer;
-        serialized_buffer.resize(serialized_bytes);
-
-        auto* buf_ptr = _key_type->serialize(*_key_column, 
serialized_buffer.data(), _be_version);
-        int64_t written_bytes = buf_ptr - serialized_buffer.data();
-        DCHECK_LE(written_bytes, serialized_bytes);
-
-        serialized_buffer.resize(serialized_bytes);
-        buf.write_binary(serialized_buffer);
-
-        serialized_bytes =
-                _value_type->get_uncompressed_serialized_bytes(*_value_column, 
_be_version);
-
-        serialized_buffer.resize(serialized_bytes);
-
-        buf_ptr = _value_type->serialize(*_value_column, 
serialized_buffer.data(), _be_version);
-        written_bytes = buf_ptr - serialized_buffer.data();
-        DCHECK_LE(written_bytes, serialized_bytes);
-
-        serialized_buffer.resize(written_bytes);
-        buf.write_binary(serialized_buffer);
+        write_column(*_key_type, *_key_column, buf, use_exact_key_frame);
+        write_column(*_value_type, *_value_column, buf, true);

Review Comment:
   Fixed in b03610b. write() now passes one std::string scratch buffer through 
both key and value write_column calls; read() likewise passes one 
PaddedPODArray<UInt8> through both read_column calls. Sequential resize 
preserves the zero-filled legacy key suffix, exact logical frame lengths, and 
StreamVByte-readable padding. Added exact/legacy round-trip unit coverage with 
both key-larger-than-value and value-larger-than-key frames. The ASAN BE unit 
suite (7 tests), versioned-state compaction regression, and IP-key regression 
all passed. No performance timing is claimed.



-- 
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]

Reply via email to