You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "zclllyybb (via GitHub)" <gi...@apache.org> on 2024/10/22 04:39:19 UTC

[PR] [branch-2.1](datetime) Fix date floor functions overflow (#35477) [doris]

zclllyybb opened a new pull request, #42238:
URL: https://github.com/apache/doris/pull/42238

   pick https://github.com/apache/doris/pull/35477


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [branch-2.1](datetime) Fix date floor functions overflow (#35477) [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #42238:
URL: https://github.com/apache/doris/pull/42238#issuecomment-2428233628

   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR)
   
   Since 2024-03-18, the Document has been moved to [doris-website](https://github.com/apache/doris-website).
   See [Doris Document](https://cwiki.apache.org/confluence/display/DORIS/Doris+Document).


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [branch-2.1](datetime) Fix date floor functions overflow (#35477) [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #42238:
URL: https://github.com/apache/doris/pull/42238#discussion_r1809935511


##########
be/src/vec/functions/function_datetime_floor_ceil.cpp:
##########
@@ -650,7 +674,7 @@
     static constexpr uint64_t MASK_YEAR_MONTH_DAY_HOUR_MINUTE_FOR_DATETIMEV2 = ((uint64_t)-1) >> 38;
 
     template <typename DateValueType>
-    static void time_round(const DateValueType& ts2, const Int32 period, DateValueType& ts1) {
+    static bool time_round(const DateValueType& ts2, const Int32 period, DateValueType& ts1) {

Review Comment:
   warning: function 'time_round' exceeds recommended size/complexity thresholds [readability-function-size]
   ```cpp
       static bool time_round(const DateValueType& ts2, const Int32 period, DateValueType& ts1) {
                   ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:676:** 145 lines including whitespace and comments (threshold 80)
   ```cpp
       static bool time_round(const DateValueType& ts2, const Int32 period, DateValueType& ts1) {
                   ^
   ```
   
   </details>
   



##########
be/src/vec/functions/function_datetime_floor_ceil.cpp:
##########
@@ -16,8 +16,6 @@
 // under the License.
 
 #include <glog/logging.h>

Review Comment:
   warning: 'glog/logging.h' file not found [clang-diagnostic-error]
   ```cpp
   #include <glog/logging.h>
            ^
   ```
   



##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -2947,14 +2951,17 @@ bool DateV2Value<T>::get_date_from_daynr(uint64_t daynr) {
         }
     }
 
-    set_time(year, month, day, this->hour(), this->minute(), this->second(), this->microsecond());
+    unchecked_set_time(year, month, day, this->hour(), this->minute(), this->second(),
+                       this->microsecond());
     return true;
 }
 
 template <typename T>
 template <TimeUnit unit, typename TO>
 bool DateV2Value<T>::date_add_interval(const TimeInterval& interval, DateV2Value<TO>& to_value) {

Review Comment:
   warning: function 'date_add_interval' has cognitive complexity of 59 (threshold 50) [readability-function-cognitive-complexity]
   ```cpp
   bool DateV2Value<T>::date_add_interval(const TimeInterval& interval, DateV2Value<TO>& to_value) {
                        ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/runtime/vdatetime_value.cpp:2961:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (!is_valid_date()) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2965:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
       int sign = interval.is_neg ? -1 : 1;
                                  ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2967:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
       if constexpr ((unit == MICROSECOND) || (unit == MILLISECOND) || (unit == SECOND) ||
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2972:** +1
   ```cpp
                     (unit == DAY_HOUR) || (unit == DAY) || (unit == WEEK)) {
                                                         ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2985:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (microseconds < 0) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2991:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (seconds < 0) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2996:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (!to_value.get_date_from_daynr(day_nr)) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2999:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           PROPAGATE_FALSE(to_value.check_range_and_set_time(
           ^
   ```
   **be/src/common/status.h:627:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
       do {                                          \
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:2999:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
           PROPAGATE_FALSE(to_value.check_range_and_set_time(
           ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
           if (UNLIKELY(!static_cast<bool>(stmt))) { \
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3001:** +1, nesting level increased to 1
   ```cpp
       } else if constexpr (unit == YEAR) {
              ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3003:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           PROPAGATE_FALSE(to_value.template set_time_unit<TimeUnit::YEAR>(date_v2_value_.year_ +
           ^
   ```
   **be/src/common/status.h:627:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
       do {                                          \
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3003:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
           PROPAGATE_FALSE(to_value.template set_time_unit<TimeUnit::YEAR>(date_v2_value_.year_ +
           ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
           if (UNLIKELY(!static_cast<bool>(stmt))) { \
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3005:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (date_v2_value_.month_ == 2 && date_v2_value_.day_ == 29 &&
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3008:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               PROPAGATE_FALSE(to_value.template set_time_unit<TimeUnit::DAY>(28));
               ^
   ```
   **be/src/common/status.h:627:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
       do {                                          \
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3008:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
               PROPAGATE_FALSE(to_value.template set_time_unit<TimeUnit::DAY>(28));
               ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
           if (UNLIKELY(!static_cast<bool>(stmt))) { \
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3010:** +1, nesting level increased to 1
   ```cpp
       } else if constexpr (unit == QUARTER || unit == MONTH || unit == YEAR_MONTH) {
              ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3010:** +1
   ```cpp
       } else if constexpr (unit == QUARTER || unit == MONTH || unit == YEAR_MONTH) {
                                                             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3014:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (months < 0) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3017:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           PROPAGATE_FALSE(to_value.template set_time_unit<TimeUnit::YEAR>(months / 12));
           ^
   ```
   **be/src/common/status.h:627:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
       do {                                          \
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3017:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
           PROPAGATE_FALSE(to_value.template set_time_unit<TimeUnit::YEAR>(months / 12));
           ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
           if (UNLIKELY(!static_cast<bool>(stmt))) { \
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3018:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           PROPAGATE_FALSE(to_value.template set_time_unit<TimeUnit::MONTH>((months % 12) + 1));
           ^
   ```
   **be/src/common/status.h:627:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
       do {                                          \
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3018:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
           PROPAGATE_FALSE(to_value.template set_time_unit<TimeUnit::MONTH>((months % 12) + 1));
           ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
           if (UNLIKELY(!static_cast<bool>(stmt))) { \
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3019:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (date_v2_value_.day_ > S_DAYS_IN_MONTH[to_value.month()]) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3021:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if (to_value.month() == 2 && doris::is_leap(to_value.year())) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3021:** +1
   ```cpp
               if (to_value.month() == 2 && doris::is_leap(to_value.year())) {
                                         ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3022:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   PROPAGATE_FALSE(
                   ^
   ```
   **be/src/common/status.h:627:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
       do {                                          \
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3022:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                   PROPAGATE_FALSE(
                   ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
           if (UNLIKELY(!static_cast<bool>(stmt))) { \
           ^
   ```
   
   </details>
   



##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -3024,7 +3032,9 @@
 template <TimeUnit unit, bool need_check>
 bool DateV2Value<T>::date_add_interval(const TimeInterval& interval) {

Review Comment:
   warning: function 'date_add_interval' has cognitive complexity of 65 (threshold 50) [readability-function-cognitive-complexity]
   ```cpp
   bool DateV2Value<T>::date_add_interval(const TimeInterval& interval) {
                        ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/runtime/vdatetime_value.cpp:3033:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
       if constexpr (need_check) {
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3034:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (!is_valid_date()) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3039:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
       int sign = interval.is_neg ? -1 : 1;
                                  ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3041:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
       if constexpr ((unit == MICROSECOND) || (unit == MILLISECOND) || (unit == SECOND) ||
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3046:** +1
   ```cpp
                     (unit == DAY_HOUR) || (unit == DAY) || (unit == WEEK)) {
                                                         ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3059:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (microseconds < 0) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3065:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (seconds < 0) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3070:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (!this->get_date_from_daynr(day_nr)) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3073:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if constexpr (is_datetime) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3074:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               PROPAGATE_FALSE(this->check_range_and_set_time(0, 0, 0, seconds / 3600,
               ^
   ```
   **be/src/common/status.h:627:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
       do {                                          \
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3074:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
               PROPAGATE_FALSE(this->check_range_and_set_time(0, 0, 0, seconds / 3600,
               ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
           if (UNLIKELY(!static_cast<bool>(stmt))) { \
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3078:** +1, nesting level increased to 1
   ```cpp
       } else if constexpr (unit == YEAR) {
              ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3080:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           PROPAGATE_FALSE(
           ^
   ```
   **be/src/common/status.h:627:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
       do {                                          \
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3080:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
           PROPAGATE_FALSE(
           ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
           if (UNLIKELY(!static_cast<bool>(stmt))) { \
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3082:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (date_v2_value_.month_ == 2 && date_v2_value_.day_ == 29 &&
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3085:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               PROPAGATE_FALSE(this->template set_time_unit<TimeUnit::DAY>(28));
               ^
   ```
   **be/src/common/status.h:627:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
       do {                                          \
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3085:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
               PROPAGATE_FALSE(this->template set_time_unit<TimeUnit::DAY>(28));
               ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
           if (UNLIKELY(!static_cast<bool>(stmt))) { \
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3087:** +1, nesting level increased to 1
   ```cpp
       } else if constexpr (unit == QUARTER || unit == MONTH || unit == YEAR_MONTH) {
              ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3087:** +1
   ```cpp
       } else if constexpr (unit == QUARTER || unit == MONTH || unit == YEAR_MONTH) {
                                                             ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3091:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (months < 0) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3094:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           PROPAGATE_FALSE(this->template set_time_unit<TimeUnit::YEAR>(months / 12));
           ^
   ```
   **be/src/common/status.h:627:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
       do {                                          \
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3094:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
           PROPAGATE_FALSE(this->template set_time_unit<TimeUnit::YEAR>(months / 12));
           ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
           if (UNLIKELY(!static_cast<bool>(stmt))) { \
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3095:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           PROPAGATE_FALSE(this->template set_time_unit<TimeUnit::MONTH>((months % 12) + 1));
           ^
   ```
   **be/src/common/status.h:627:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
       do {                                          \
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3095:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
           PROPAGATE_FALSE(this->template set_time_unit<TimeUnit::MONTH>((months % 12) + 1));
           ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
           if (UNLIKELY(!static_cast<bool>(stmt))) { \
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3096:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (date_v2_value_.day_ > S_DAYS_IN_MONTH[this->month()]) {
           ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3098:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if (this->month() == 2 && doris::is_leap(this->year())) {
               ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3098:** +1
   ```cpp
               if (this->month() == 2 && doris::is_leap(this->year())) {
                                      ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3099:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   PROPAGATE_FALSE(
                   ^
   ```
   **be/src/common/status.h:627:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
       do {                                          \
       ^
   ```
   **be/src/vec/runtime/vdatetime_value.cpp:3099:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                   PROPAGATE_FALSE(
                   ^
   ```
   **be/src/common/status.h:628:** expanded from macro 'PROPAGATE_FALSE'
   ```cpp
           if (UNLIKELY(!static_cast<bool>(stmt))) { \
           ^
   ```
   
   </details>
   



##########
be/src/vec/functions/function_datetime_floor_ceil.cpp:
##########
@@ -650,7 +674,7 @@
     static constexpr uint64_t MASK_YEAR_MONTH_DAY_HOUR_MINUTE_FOR_DATETIMEV2 = ((uint64_t)-1) >> 38;
 
     template <typename DateValueType>
-    static void time_round(const DateValueType& ts2, const Int32 period, DateValueType& ts1) {
+    static bool time_round(const DateValueType& ts2, const Int32 period, DateValueType& ts1) {

Review Comment:
   warning: function 'time_round' has cognitive complexity of 52 (threshold 50) [readability-function-cognitive-complexity]
   ```cpp
       static bool time_round(const DateValueType& ts2, const Int32 period, DateValueType& ts1) {
                   ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:680:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if constexpr (std::is_same_v<DateValueType, VecDateTimeValue>) {
           ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:681:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == YEAR) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:686:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == MONTH) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:691:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == WEEK) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:698:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == DAY) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:703:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == HOUR) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:708:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == MINUTE) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:714:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == SECOND) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:719:** +1, nesting level increased to 1
   ```cpp
           } else if constexpr (std::is_same_v<DateValueType, DateV2Value<DateV2ValueType>>) {
                  ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:720:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == YEAR) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:725:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == MONTH) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:730:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == WEEK) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:737:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == DAY) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:742:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == HOUR) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:747:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == MINUTE) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:753:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == SECOND) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:758:** +1, nesting level increased to 1
   ```cpp
           } else if constexpr (std::is_same_v<DateValueType, DateV2Value<DateTimeV2ValueType>>) {
                  ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:759:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == YEAR) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:764:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == MONTH) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:769:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == WEEK) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:776:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == DAY) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:781:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == HOUR) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:786:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == MINUTE) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:794:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (Impl::Unit == SECOND) {
               ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:802:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if constexpr (Impl::Type == CEIL) {
           ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:806:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if constexpr (Impl::Type == FLOOR) {
           ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:813:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           int64_t delta_inside_period = diff >= 0 ? diff % count : (diff % count + count) % count;
                                                   ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:815:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
                          (Impl::Type == FLOOR        ? 0
                                                      ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:816:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
                           : delta_inside_period == 0 ? 0
                                                      ^
   ```
   **be/src/vec/functions/function_datetime_floor_ceil.cpp:819:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           TimeInterval interval(Impl::Unit, is_neg ? -step : step, is_neg);
                                                    ^
   ```
   
   </details>
   



-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [branch-2.1](datetime) Fix date floor functions overflow (#35477) [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #42238:
URL: https://github.com/apache/doris/pull/42238#issuecomment-2428285601

   TeamCity be ut coverage result:
    Function Coverage: 36.00% (9345/25959) 
    Line Coverage: 27.58% (76817/278511)
    Region Coverage: 26.38% (39439/149528)
    Branch Coverage: 23.17% (20078/86660)
    Coverage Report: http://coverage.selectdb-in.cc/coverage/e532574c51b0b9dd3f6f3ecaca219f155011a02d_e532574c51b0b9dd3f6f3ecaca219f155011a02d/report/index.html


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [branch-2.1](datetime) Fix date floor functions overflow (#35477) [doris]

Posted by "zclllyybb (via GitHub)" <gi...@apache.org>.
zclllyybb commented on PR #42238:
URL: https://github.com/apache/doris/pull/42238#issuecomment-2428233700

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [branch-2.1](datetime) Fix date floor functions overflow (#35477) [doris]

Posted by "zclllyybb (via GitHub)" <gi...@apache.org>.
zclllyybb commented on PR #42238:
URL: https://github.com/apache/doris/pull/42238#issuecomment-2428255406

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [branch-2.1](datetime) Fix date floor functions overflow (#35477) [doris]

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #42238:
URL: https://github.com/apache/doris/pull/42238


-- 
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-unsubscribe@doris.apache.org

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


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