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


##########
be/src/vec/functions/date_format_type.h:
##########
@@ -89,26 +92,48 @@ struct yyyy_MM_dd_HH_mm_ssImpl {
         int i = 0;
         put_year(date_value.year(), buf, i);
         buf[i++] = '-';
-        put_other(date_value.month(), buf, i);
+        put_two_digits(date_value.month(), buf, i);
         buf[i++] = '-';
-        put_other(date_value.day(), buf, i);
+        put_two_digits(date_value.day(), buf, i);
         buf[i++] = ' ';
-        put_other(date_value.hour(), buf, i);
+        put_two_digits(date_value.hour(), buf, i);
         buf[i++] = ':';
-        put_other(date_value.minute(), buf, i);
+        put_two_digits(date_value.minute(), buf, i);
         buf[i++] = ':';
-        put_other(date_value.second(), buf, i);
+        put_two_digits(date_value.second(), buf, i);
         return i;
     }
 };
 
+struct yyyy_MM_dd_HH_mm_ss_SSSSSSImpl {
+    size_t static date_to_str(const DateV2Value<DateTimeV2ValueType>& 
date_value, char* buf) {
+        int i = 0;
+        put_year(date_value.year(), buf, i);
+        buf[i++] = '-';
+        put_two_digits(date_value.month(), buf, i);
+        buf[i++] = '-';
+        put_two_digits(date_value.day(), buf, i);
+        buf[i++] = ' ';
+        put_two_digits(date_value.hour(), buf, i);
+        buf[i++] = ':';
+        put_two_digits(date_value.minute(), buf, i);
+        buf[i++] = ':';
+        put_two_digits(date_value.second(), buf, i);
+        buf[i++] = '.';
+        int length = common::count_digits_fast(date_value.microsecond());

Review Comment:
   the length could be negative or bigger than 6?



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