github-actions[bot] commented on code in PR #44454:
URL: https://github.com/apache/doris/pull/44454#discussion_r1853307532


##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -683,9 +685,9 @@
     return dst + 4;
 }
 
-bool VecDateTimeValue::to_format_string_conservative(const char* format, int 
len, char* to,
-                                                     int max_valid_length) 
const {
-    if (check_range(_year, _month, _day, _hour, _minute, _second, _type)) {
+bool VecDateTimeValue::to_format_string_conservative(const char* format, 
size_t len, char* to,

Review Comment:
   warning: function 'to_format_string_conservative' has cognitive complexity 
of 60 (threshold 50) [readability-function-cognitive-complexity]
   ```cpp
   bool VecDateTimeValue::to_format_string_conservative(const char* format, 
size_t len, char* to,
                          ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/runtime/vdatetime_value.cpp:689:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (check_range(_year, _month, _day, _hour, _minute, (uint8_t)_second, 
_type)) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:700:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       while (ptr < end) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:701:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (to - begin + SAFE_FORMAT_STRING_MARGIN > max_valid_length) 
[[unlikely]] {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:704:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (*ptr != '%' || (ptr + 1) == end) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:704:** +1
   ```cpp
           if (*ptr != '%' || (ptr + 1) == end) {
                           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:710:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           switch (ch = *ptr++) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:761:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_type == TIME_TIME || (_year == 0 && _month == 0)) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:761:** +1
   ```cpp
               if (_type == TIME_TIME || (_year == 0 && _month == 0)) {
                                      ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:761:** +1
   ```cpp
               if (_type == TIME_TIME || (_year == 0 && _month == 0)) {
                                                     ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:768:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_month == 0) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:782:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_day >= 10 && _day <= 19) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:782:** +1
   ```cpp
               if (_day >= 10 && _day <= 19) {
                              ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:784:** +1, nesting level increased 
to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:785:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   switch (_day % 10) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:828:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_month == 0) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:835:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if ((_hour % 24) >= 12) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:837:** +1, nesting level increased 
to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:853:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if ((_hour % 24) >= 12) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:855:** +1, nesting level increased 
to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:875:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_type == TIME_TIME) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:885:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_type == TIME_TIME) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:895:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_type == TIME_TIME) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:905:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_type == TIME_TIME) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:914:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_type == TIME_TIME || (_month == 0 && _year == 0)) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:914:** +1
   ```cpp
               if (_type == TIME_TIME || (_month == 0 && _year == 0)) {
                                      ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:914:** +1
   ```cpp
               if (_type == TIME_TIME || (_month == 0 && _year == 0)) {
                                                      ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:927:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_type == TIME_TIME) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:940:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (_type == TIME_TIME) {
               ^
   ```
   
   </details>
   



##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -92,16 +93,16 @@
 // The interval format is that with no delimiters
 // YYYY-MM-DD HH-MM-DD.FFFFFF AM in default format
 // 0    1  2  3  4  5  6      7
-bool VecDateTimeValue::from_date_str(const char* date_str, int len) {
+bool VecDateTimeValue::from_date_str(const char* date_str, size_t len) {
     return from_date_str_base(date_str, len, nullptr);
 }
 //parse timezone to get offset
-bool VecDateTimeValue::from_date_str(const char* date_str, int len,
+bool VecDateTimeValue::from_date_str(const char* date_str, size_t len,
                                      const cctz::time_zone& local_time_zone) {
     return from_date_str_base(date_str, len, &local_time_zone);
 }
 
-bool VecDateTimeValue::from_date_str_base(const char* date_str, int len,
+bool VecDateTimeValue::from_date_str_base(const char* date_str, size_t len,

Review Comment:
   warning: function 'from_date_str_base' exceeds recommended size/complexity 
thresholds [readability-function-size]
   ```cpp
   bool VecDateTimeValue::from_date_str_base(const char* date_str, size_t len,
                          ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/runtime/vdatetime_value.cpp:104:** 154 lines including 
whitespace and comments (threshold 80)
   ```cpp
   bool VecDateTimeValue::from_date_str_base(const char* date_str, size_t len,
                          ^
   ```
   
   </details>
   



##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -92,16 +93,16 @@ bool VecDateTimeValue::check_date(uint32_t year, uint32_t 
month, uint32_t day) {
 // The interval format is that with no delimiters
 // YYYY-MM-DD HH-MM-DD.FFFFFF AM in default format
 // 0    1  2  3  4  5  6      7
-bool VecDateTimeValue::from_date_str(const char* date_str, int len) {
+bool VecDateTimeValue::from_date_str(const char* date_str, size_t len) {
     return from_date_str_base(date_str, len, nullptr);
 }
 //parse timezone to get offset
-bool VecDateTimeValue::from_date_str(const char* date_str, int len,
+bool VecDateTimeValue::from_date_str(const char* date_str, size_t len,
                                      const cctz::time_zone& local_time_zone) {
     return from_date_str_base(date_str, len, &local_time_zone);
 }
 
-bool VecDateTimeValue::from_date_str_base(const char* date_str, int len,
+bool VecDateTimeValue::from_date_str_base(const char* date_str, size_t len,

Review Comment:
   warning: function 'from_date_str_base' has cognitive complexity of 72 
(threshold 50) [readability-function-cognitive-complexity]
   ```cpp
   bool VecDateTimeValue::from_date_str_base(const char* date_str, size_t len,
                          ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/runtime/vdatetime_value.cpp:116:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       while (ptr < end && check_space(*ptr)) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:116:** +1
   ```cpp
       while (ptr < end && check_space(*ptr)) {
                        ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:119:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (ptr == end || !isdigit(*ptr)) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:119:** +1
   ```cpp
       if (ptr == end || !isdigit(*ptr)) {
                      ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:124:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       while (pos < end && (isdigit(*pos) || *pos == 'T')) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:124:** +1
   ```cpp
       while (pos < end && (isdigit(*pos) || *pos == 'T')) {
                        ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:124:** +1
   ```cpp
       while (pos < end && (isdigit(*pos) || *pos == 'T')) {
                                          ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:134:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (pos == end || *pos == '.') {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:134:** +1
   ```cpp
       if (pos == end || *pos == '.') {
                      ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:135:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (digits == 4 || digits == 8 || digits >= 14) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:135:** +1
   ```cpp
           if (digits == 4 || digits == 8 || digits >= 14) {
                                          ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:137:** +1, nesting level increased 
to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:146:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       while (ptr < end && isdigit(*ptr) && field_idx < MAX_DATE_PARTS - 1) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:146:** +1
   ```cpp
       while (ptr < end && isdigit(*ptr) && field_idx < MAX_DATE_PARTS - 1) {
                                         ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:149:** +1
   ```cpp
           bool scan_to_delim = (!is_interval_format) && (field_idx != 6);
                                                      ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:150:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           while (ptr < end && isdigit(*ptr) && (scan_to_delim || field_len--)) 
{
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:150:** +1
   ```cpp
           while (ptr < end && isdigit(*ptr) && (scan_to_delim || field_len--)) 
{
                                             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:150:** +1
   ```cpp
           while (ptr < end && isdigit(*ptr) && (scan_to_delim || field_len--)) 
{
                                                               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:154:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (temp_val > 999999L) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:161:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (ptr == end) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:167:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (UNLIKELY((field_idx > 2 ||
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:169:** +1
   ```cpp
                        && time_zone_begins(ptr, end))) {
                        ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:167:** +1
   ```cpp
           if (UNLIKELY((field_idx > 2 ||
                                       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:170:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (local_time_zone == nullptr) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:173:** nesting level increased to 3
   ```cpp
               auto get_tz_offset = [&](const std::string& str_tz,
                                    ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:176:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!TimezoneUtils::find_cctz_time_zone(str_tz, given_tz)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:187:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               } catch ([[maybe_unused]] Exception& e) {
                 ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:194:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (field_idx == 2 && *ptr == 'T') {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:194:** +1
   ```cpp
           if (field_idx == 2 && *ptr == 'T') {
                              ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:202:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (field_idx == 5) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:203:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (*ptr == '.') {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:206:** +1, nesting level increased 
to 3
   ```cpp
               } else if (isdigit(*ptr)) {
                      ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:214:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           while (ptr < end && (check_date_punct(*ptr) || check_space(*ptr))) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:214:** +1
   ```cpp
           while (ptr < end && (check_date_punct(*ptr) || check_space(*ptr))) {
                            ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:214:** +1
   ```cpp
           while (ptr < end && (check_date_punct(*ptr) || check_space(*ptr))) {
                                                       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:215:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (check_space(*ptr)) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:216:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (((1 << field_idx) & allow_space_mask) == 0) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:220:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (*ptr == '-') {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:228:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (num_field <= 3) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:230:** +1, nesting level increased 
to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:233:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (!is_interval_format) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:236:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       for (; field_idx < MAX_DATE_PARTS; ++field_idx) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:241:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (year_len == 2) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:242:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (date_val[0] < YY_PART_YEAR) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:244:** +1, nesting level increased 
to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:249:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (num_field < 3) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:252:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (!check_range_and_set_time(date_val[0], date_val[1], date_val[2], 
date_val[3], date_val[4],
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:256:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       return sec_offset ? date_add_interval<TimeUnit::SECOND>(
                         ^
   ```
   
   </details>
   



##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -1992,19 +1994,19 @@
 // YYYY-MM-DD HH-MM-DD.FFFFFF AM in default format
 // 0    1  2  3  4  5  6      7
 template <typename T>
-bool DateV2Value<T>::from_date_str(const char* date_str, int len, int scale /* 
= -1*/,
+bool DateV2Value<T>::from_date_str(const char* date_str, size_t len, int scale 
/* = -1*/,
                                    bool convert_zero) {
     return from_date_str_base(date_str, len, scale, nullptr, convert_zero);
 }
 template <typename T>
-bool DateV2Value<T>::from_date_str(const char* date_str, int len,
+bool DateV2Value<T>::from_date_str(const char* date_str, size_t len,
                                    const cctz::time_zone& local_time_zone, int 
scale /* = -1*/,
                                    bool convert_zero) {
     return from_date_str_base(date_str, len, scale, &local_time_zone, 
convert_zero);
 }
 // if local_time_zone is null, only be able to parse time without timezone
 template <typename T>
-bool DateV2Value<T>::from_date_str_base(const char* date_str, int len, int 
scale,
+bool DateV2Value<T>::from_date_str_base(const char* date_str, size_t len, int 
scale,

Review Comment:
   warning: function 'from_date_str_base' exceeds recommended size/complexity 
thresholds [readability-function-size]
   ```cpp
   bool DateV2Value<T>::from_date_str_base(const char* date_str, size_t len, 
int scale,
                        ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/runtime/vdatetime_value.cpp:2008:** 238 lines including 
whitespace and comments (threshold 80)
   ```cpp
   bool DateV2Value<T>::from_date_str_base(const char* date_str, size_t len, 
int scale,
                        ^
   ```
   
   </details>
   



##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -1204,7 +1206,7 @@
 // this method is exactly same as fromDateFormatStr() in DateLiteral.java in FE
 // change this method should also change that.
 bool VecDateTimeValue::from_date_format_str(const char* format, int 
format_len, const char* value,

Review Comment:
   warning: function 'from_date_format_str' has cognitive complexity of 207 
(threshold 50) [readability-function-cognitive-complexity]
   ```cpp
   bool VecDateTimeValue::from_date_format_str(const char* format, int 
format_len, const char* value,
                          ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/runtime/vdatetime_value.cpp:1209:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (value_len <= 0) [[unlikely]] {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1246:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       while (ptr < end && val < val_end) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1246:** +1
   ```cpp
       while (ptr < end && val < val_end) {
                        ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1248:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           while (val < val_end && check_space(*val)) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1248:** +1
   ```cpp
           while (val < val_end && check_space(*val)) {
                                ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1251:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (val >= val_end) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1255:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (*ptr == '%' && ptr + 1 < end) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1255:** +1
   ```cpp
           if (*ptr == '%' && ptr + 1 < end) {
                           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1259:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               switch (*ptr++) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1264:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!str_to_int64(val, &tmp, &int_value)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1267:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   int_value += int_value >= 70 ? 1900 : 2000;
                                                ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1275:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!str_to_int64(val, &tmp, &int_value)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1278:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (tmp - val <= 2) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1279:** +5, including nesting 
penalty of 4, nesting level increased to 5
   ```cpp
                       int_value += int_value >= 70 ? 1900 : 2000;
                                                    ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1289:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!str_to_int64(val, &tmp, &int_value)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1298:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (int_value < 0) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1306:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (int_value < 0) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1316:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!str_to_int64(val, &tmp, &int_value)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1325:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!str_to_int64(val, &tmp, &int_value)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1342:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!str_to_int64(val, &tmp, &int_value)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1352:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!str_to_int64(val, &tmp, &int_value)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1363:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!str_to_int64(val, &tmp, &int_value)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1374:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!str_to_int64(val, &tmp, &int_value)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1381:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if ((val_end - val) < 2 || toupper(*(val + 1)) != 'M' || 
!hour_system_12) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1381:** +1
   ```cpp
                   if ((val_end - val) < 2 || toupper(*(val + 1)) != 'M' || 
!hour_system_12) {
                                                                         ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1384:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (toupper(*val) == 'P') {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1393:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (int_value < 0) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1402:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (int_value < 0) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1411:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!str_to_int64(val, &tmp, &int_value)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1414:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (int_value >= 7) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1417:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (int_value == 0) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1426:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!str_to_int64(val, &tmp, &int_value)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1437:** +1
   ```cpp
                   sunday_first = (*(ptr - 1) == 'U' || *(ptr - 1) == 'V');
                                                     ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1439:** +1
   ```cpp
                   strict_week_number = (*(ptr - 1) == 'V' || *(ptr - 1) == 
'v');
                                                           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1441:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!str_to_int64(val, &tmp, &int_value)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1445:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (week_num > 53 || (strict_week_number && week_num == 0)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1445:** +1
   ```cpp
                   if (week_num > 53 || (strict_week_number && week_num == 0)) {
                                     ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1445:** +1
   ```cpp
                   if (week_num > 53 || (strict_week_number && week_num == 0)) {
                                                            ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1456:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!str_to_int64(val, &tmp, &int_value)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1465:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!tmp_val.from_date_format_str("%I:%i:%S %p", 11, val, 
val_end - val, &tmp)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1478:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (!tmp_val.from_date_format_str("%H:%i:%S", 8, val, 
val_end - val, &tmp)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1490:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   while (val < val_end && ispunct(*val)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1490:** +1
   ```cpp
                   while (val < val_end && ispunct(*val)) {
                                        ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1495:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   while (val < val_end && isalpha(*val)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1495:** +1
   ```cpp
                   while (val < val_end && isalpha(*val)) {
                                        ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1500:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   while (val < val_end && isdigit(*val)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1500:** +1
   ```cpp
                   while (val < val_end && isdigit(*val)) {
                                        ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1505:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if ('%' != *val) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1513:** +1, nesting level increased 
to 2
   ```cpp
           } else if (!check_space(*ptr)) {
                  ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1514:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (*ptr != *val) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1519:** +1, nesting level increased 
to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1525:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       while (ptr < end) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1526:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (*ptr == '%' && ptr + 1 < end) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1526:** +1
   ```cpp
           if (*ptr == '%' && ptr + 1 < end) {
                           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1528:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               switch (*ptr++) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1546:** +1, nesting level increased 
to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1551:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (!part_used) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1555:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (hour_system_12) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1556:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (hour > 12 || hour < 1) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1556:** +1
   ```cpp
           if (hour > 12 || hour < 1) {
                         ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1561:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (sub_val_end) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1566:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (part_used & DATE_PART) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1567:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (part_used & TIME_PART) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1569:** +1, nesting level increased 
to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1572:** +1, nesting level increased 
to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1579:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (yearday > 0) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1581:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (!get_date_from_daynr(days)) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1586:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (week_num >= 0 && weekday > 0) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1586:** +1
   ```cpp
       if (week_num >= 0 && weekday > 0) {
                         ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1588:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if ((strict_week_number &&
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1589:** +1
   ```cpp
                (strict_week_number_year < 0 || strict_week_number_year_type != 
sunday_first)) ||
                                                                                
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1588:** +1
   ```cpp
           if ((strict_week_number &&
                                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1589:** +1
   ```cpp
                (strict_week_number_year < 0 || strict_week_number_year_type != 
sunday_first)) ||
                                             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1590:** +1
   ```cpp
               (!strict_week_number && strict_week_number_year >= 0)) {
                                    ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1594:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
                   (uint16_t)(strict_week_number ? strict_week_number_year : 
year), 1, 1);
                                                 ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1598:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (sunday_first) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1599:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               days += ((weekday_b == 0) ? 0 : 7) - weekday_b + (week_num - 1) 
* 7 + weekday % 7;
                                         ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1600:** +1, nesting level increased 
to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1601:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               days += ((weekday_b <= 3) ? 0 : 7) - weekday_b + (week_num - 1) 
* 7 + weekday - 1;
                                         ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1603:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (!get_date_from_daynr(days)) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1611:** +1
   ```cpp
       bool already_set_date_part = yearday > 0 || (week_num >= 0 && weekday > 
0);
                                                ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1611:** +1
   ```cpp
       bool already_set_date_part = yearday > 0 || (week_num >= 0 && weekday > 
0);
                                                                  ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1612:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (already_set_date_part && already_set_time_part) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1612:** +1
   ```cpp
       if (already_set_date_part && already_set_time_part) {
                                 ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1616:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (!(part_used & ~NORMAL_DATE_PART)) { // Ymd part only
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1617:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (!(part_used & DAY_PART)) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1619:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (!(part_used & MONTH_PART)) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1625:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (already_set_date_part) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:1628:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (already_set_time_part) {
       ^
   ```
   
   </details>
   



##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -683,9 +685,9 @@
     return dst + 4;
 }
 
-bool VecDateTimeValue::to_format_string_conservative(const char* format, int 
len, char* to,
-                                                     int max_valid_length) 
const {
-    if (check_range(_year, _month, _day, _hour, _minute, _second, _type)) {
+bool VecDateTimeValue::to_format_string_conservative(const char* format, 
size_t len, char* to,

Review Comment:
   warning: function 'to_format_string_conservative' exceeds recommended 
size/complexity thresholds [readability-function-size]
   ```cpp
   bool VecDateTimeValue::to_format_string_conservative(const char* format, 
size_t len, char* to,
                          ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/runtime/vdatetime_value.cpp:687:** 270 lines including 
whitespace and comments (threshold 80)
   ```cpp
   bool VecDateTimeValue::to_format_string_conservative(const char* format, 
size_t len, char* to,
                          ^
   ```
   
   </details>
   



##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -3449,8 +3451,8 @@
 }
 
 template <typename T>
-bool DateV2Value<T>::to_format_string_conservative(const char* format, int 
len, char* to,
-                                                   int max_valid_length) const 
{
+bool DateV2Value<T>::to_format_string_conservative(const char* format, size_t 
len, char* to,

Review Comment:
   warning: function 'to_format_string_conservative' exceeds recommended 
size/complexity thresholds [readability-function-size]
   ```cpp
   bool DateV2Value<T>::to_format_string_conservative(const char* format, 
size_t len, char* to,
                        ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/runtime/vdatetime_value.cpp:3453:** 256 lines including 
whitespace and comments (threshold 80)
   ```cpp
   bool DateV2Value<T>::to_format_string_conservative(const char* format, 
size_t len, char* to,
                        ^
   ```
   
   </details>
   



##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -1992,19 +1994,19 @@
 // YYYY-MM-DD HH-MM-DD.FFFFFF AM in default format
 // 0    1  2  3  4  5  6      7
 template <typename T>
-bool DateV2Value<T>::from_date_str(const char* date_str, int len, int scale /* 
= -1*/,
+bool DateV2Value<T>::from_date_str(const char* date_str, size_t len, int scale 
/* = -1*/,
                                    bool convert_zero) {
     return from_date_str_base(date_str, len, scale, nullptr, convert_zero);
 }
 template <typename T>
-bool DateV2Value<T>::from_date_str(const char* date_str, int len,
+bool DateV2Value<T>::from_date_str(const char* date_str, size_t len,
                                    const cctz::time_zone& local_time_zone, int 
scale /* = -1*/,
                                    bool convert_zero) {
     return from_date_str_base(date_str, len, scale, &local_time_zone, 
convert_zero);
 }
 // if local_time_zone is null, only be able to parse time without timezone
 template <typename T>
-bool DateV2Value<T>::from_date_str_base(const char* date_str, int len, int 
scale,
+bool DateV2Value<T>::from_date_str_base(const char* date_str, size_t len, int 
scale,

Review Comment:
   warning: function 'from_date_str_base' has cognitive complexity of 116 
(threshold 50) [readability-function-cognitive-complexity]
   ```cpp
   bool DateV2Value<T>::from_date_str_base(const char* date_str, size_t len, 
int scale,
                        ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/runtime/vdatetime_value.cpp:2018:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       while (ptr < end && check_space(*ptr)) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2018:** +1
   ```cpp
       while (ptr < end && check_space(*ptr)) {
                        ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2021:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (ptr == end || !isdigit(*ptr)) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2021:** +1
   ```cpp
       if (ptr == end || !isdigit(*ptr)) {
                      ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2026:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       while (pos < end && (isdigit(*pos) || *pos == 'T')) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2026:** +1
   ```cpp
       while (pos < end && (isdigit(*pos) || *pos == 'T')) {
                        ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2026:** +1
   ```cpp
       while (pos < end && (isdigit(*pos) || *pos == 'T')) {
                                          ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2036:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (pos == end || *pos == '.' ||
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2036:** +1
   ```cpp
       if (pos == end || *pos == '.' ||
                                     ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2038:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (digits == 4 || digits == 8 || digits >= 14) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2038:** +1
   ```cpp
           if (digits == 4 || digits == 8 || digits >= 14) {
                                          ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2040:** +1, nesting level increased 
to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2051:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       while (ptr < end && isdigit(*ptr) && field_idx < MAX_DATE_PARTS) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2051:** +1
   ```cpp
       while (ptr < end && isdigit(*ptr) && field_idx < MAX_DATE_PARTS) {
                                         ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2054:** +1
   ```cpp
           bool scan_to_delim = (!is_interval_format) && (field_idx != 6);
                                                      ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2055:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           while (ptr < end && isdigit(*ptr) && (scan_to_delim || field_len--)) 
{ // field_len <= 7
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2055:** +1
   ```cpp
           while (ptr < end && isdigit(*ptr) && (scan_to_delim || field_len--)) 
{ // field_len <= 7
                                             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2055:** +1
   ```cpp
           while (ptr < end && isdigit(*ptr) && (scan_to_delim || field_len--)) 
{ // field_len <= 7
                                                               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2060:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (ptr == start) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2064:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (field_idx == 6) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2065:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if constexpr (is_datetime) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2070:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (scale >= 0) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2081:** +5, including nesting 
penalty of 4, nesting level increased to 5
   ```cpp
                       if (reminder >= 5 * normalizer) {
                       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2086:** +5, including nesting 
penalty of 4, nesting level increased to 5
   ```cpp
                       if (temp_val == int_exp10(7)) {
                       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2089:** +1, nesting level increased 
to 5
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2095:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   while (ptr < end && isdigit(*ptr)) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2095:** +1
   ```cpp
                   while (ptr < end && isdigit(*ptr)) {
                                    ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2098:** +1, nesting level increased 
to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2106:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (temp_val > 999999L) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2112:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (field_idx == 6) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2116:** +1, nesting level increased 
to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2122:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (ptr == end) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2128:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (UNLIKELY((field_idx > 2 ||
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2130:** +1
   ```cpp
                        && time_zone_begins(ptr, end))) {
                        ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2128:** +1
   ```cpp
           if (UNLIKELY((field_idx > 2 ||
                                       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2131:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (local_time_zone == nullptr) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2139:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (field_idx == 2 && *ptr == 'T') {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2139:** +1
   ```cpp
           if (field_idx == 2 && *ptr == 'T') {
                              ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2147:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (field_idx == 5) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2148:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (*ptr == '.') {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2153:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if constexpr (is_datetime) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2155:** +1, nesting level increased 
to 4
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2158:** +1, nesting level increased 
to 3
   ```cpp
               } else if (isdigit(*ptr)) {
                      ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2166:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           while (ptr < end && (check_date_punct(*ptr) || check_space(*ptr))) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2166:** +1
   ```cpp
           while (ptr < end && (check_date_punct(*ptr) || check_space(*ptr))) {
                            ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2166:** +1
   ```cpp
           while (ptr < end && (check_date_punct(*ptr) || check_space(*ptr))) {
                                                       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2167:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (check_space(*ptr)) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2168:** +4, including nesting 
penalty of 3, nesting level increased to 4
   ```cpp
                   if (((1 << field_idx) & allow_space_mask) == 0) {
                   ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2172:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (*ptr == '-') {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2181:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (!is_interval_format) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2184:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       for (; field_idx < MAX_DATE_PARTS; ++field_idx) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2188:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (year_len == 2) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2189:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (date_val[0] < YY_PART_YEAR) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2191:** +1, nesting level increased 
to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2196:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (num_field < 3) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2199:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (is_invalid(date_val[0], date_val[1], date_val[2], 0, 0, 0, 0)) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2200:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (date_val[0] == 0 && date_val[1] == 0 && date_val[2] == 0 && 
convert_zero) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2200:** +1
   ```cpp
           if (date_val[0] == 0 && date_val[1] == 0 && date_val[2] == 0 && 
convert_zero) {
                                                                        ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2203:** +1, nesting level increased 
to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2208:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (need_use_timezone) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2210:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (!TimezoneUtils::find_cctz_time_zone(std::string {ptr, end}, 
given_tz)) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2223:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if constexpr (!is_datetime) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2224:** +2, including nesting 
penalty of 1, nesting level increased to 2
   ```cpp
           if (sec_offset) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2226:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (!tmp.check_range_and_set_time(date_val[0], date_val[1], 
date_val[2], date_val[3],
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2230:** +3, including nesting 
penalty of 2, nesting level increased to 3
   ```cpp
               if (!tmp.date_add_interval<TimeUnit::SECOND>(
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2239:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       if (!check_range_and_set_time(date_val[0], date_val[1], date_val[2], 
date_val[3], date_val[4],
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2244:** +1, including nesting 
penalty of 0, nesting level increased to 1
   ```cpp
       return sec_offset ? date_add_interval<TimeUnit::SECOND>(
                         ^
   ```
   
   </details>
   



##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -1728,21 +1730,21 @@
         }
     } else if constexpr ((unit == DAY)) {
         // This only change day information, not change second information
-        int64_t day_nr = interval.day;
+        uint32_t day_nr = (uint32_t)(interval.day);

Review Comment:
   warning: use auto when initializing with a cast to avoid duplicating the 
type name [modernize-use-auto]
   
   ```suggestion
           auto day_nr = (uint32_t)(interval.day);
   ```
   



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to