HappenLee commented on code in PR #40916:
URL: https://github.com/apache/doris/pull/40916#discussion_r1764900727


##########
be/src/vec/data_types/data_type_date.cpp:
##########
@@ -42,14 +42,16 @@ bool DataTypeDate::equals(const IDataType& rhs) const {
 }
 
 size_t DataTypeDate::number_length() const {
-    return 10;
+    return sizeof("2024-01-01"); //11
 }
 void DataTypeDate::push_number(ColumnString::Chars& chars, const Int64& num) 
const {
     doris::VecDateTimeValue value = binary_cast<Int64, 
doris::VecDateTimeValue>(num);
-    char buf[64];
-    char* pos = value.to_string(buf);
-    // DateTime to_string the end is /0
-    chars.insert(buf, pos - 1);
+
+    const auto old_size = chars.size();
+    const auto len = value.to_buffer((char*)chars.data() + old_size);

Review Comment:
   how you sure the memory length is enough or segment fault?



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