yiguolei commented on code in PR #52676:
URL: https://github.com/apache/doris/pull/52676#discussion_r2179696126
##########
be/src/vec/data_types/serde/data_type_ipv6_serde.cpp:
##########
@@ -206,21 +206,41 @@ Status DataTypeIPv6SerDe::write_column_to_orc(const
std::string& timezone, const
const auto& col_data = assert_cast<const ColumnIPv6&>(column).get_data();
auto* cur_batch = assert_cast<orc::StringVectorBatch*>(orc_col_batch);
- INIT_MEMORY_FOR_ORC_WRITER()
-
+ // First pass: calculate total memory needed and collect serialized values
+ std::vector<std::string> serialized_values;
+ std::vector<size_t> valid_row_indices;
+ size_t total_size = 0;
for (size_t row_id = start; row_id < end; row_id++) {
if (cur_batch->notNull[row_id] == 1) {
- std::string ipv6_str = IPv6Value::to_string(col_data[row_id]);
- size_t len = ipv6_str.size();
-
- REALLOC_MEMORY_FOR_ORC_WRITER()
-
- strcpy(const_cast<char*>(bufferRef.data) + offset,
ipv6_str.c_str());
- cur_batch->data[row_id] = const_cast<char*>(bufferRef.data) +
offset;
- cur_batch->length[row_id] = len;
- offset += len;
+ auto serialized_value =
Review Comment:
为啥这里要make unique string 啊?
直接 std::string 不行吗?
--
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]