zclllyybb commented on code in PR #32065:
URL: https://github.com/apache/doris/pull/32065#discussion_r1520828913


##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -1187,6 +1188,99 @@ static int check_word(const char* lib[], const char* 
str, const char* end, const
     return pos;
 }
 
+bool VecDateTimeValue::from_simple_format(const char* format, size_t 
format_len, const char* value,
+                                          size_t value_len) {
+    if (value_len <= 0) [[unlikely]] {
+        return false;
+    }
+    const char* val = value;
+    const char* val_end = value + value_len;
+    const static std::string simple_format[3] = {"%Y-%m-%d", "%Y-%m-%d 
%H:%i:%s", "%H:%i:%s"};
+    StringRef format_r {format, format_len};
+    auto [year, month, day, hour, minute, second] = std::tuple {0, 0, 0, 0, 0, 
0};
+    if (format_r == StringRef {simple_format[0].data(), 
simple_format[0].size()}) {
+        const char *end1 = val + 4, *end2 = val + 6;

Review Comment:
   don't use `end1`, `end2`... use a meaningful name



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