BiteTheDDDDt commented on code in PR #52675:
URL: https://github.com/apache/doris/pull/52675#discussion_r2184864384


##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -3166,15 +3110,9 @@ bool DateV2Value<T>::datetime_trunc() {
             } else {
                 date_v2_value_.month_ = 10;
             }
-            break;
-        }
-        case YEAR: {
+        } else if constexpr (unit == YEAR) {
             date_v2_value_.day_ = 1;
             date_v2_value_.month_ = 1;
-            break;
-        }
-        default:
-            return false;

Review Comment:
   这里还不能return false,因为原本有一些其他类型在switch里,比如date类型trunc秒单位,实际上是什么都不做直接返回



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