linrrzqqq commented on code in PR #57893:
URL: https://github.com/apache/doris/pull/57893#discussion_r2555016206


##########
be/src/vec/functions/date_time_transforms.h:
##########
@@ -74,6 +74,22 @@ namespace doris::vectorized {
 #define TO_TIME_FUNCTION(CLASS, UNIT) TIME_FUNCTION_IMPL(CLASS, UNIT, UNIT())
 
 TO_TIME_FUNCTION(ToYearImpl, year);
+template <PrimitiveType PType>
+struct ToCenturyImpl {
+    static constexpr PrimitiveType OpArgType = PType;
+    using NativeType = typename PrimitiveTypeTraits<PType>::CppNativeType;
+    static constexpr auto name = "century";
+
+    static inline auto execute(const NativeType& t) {
+        const auto& date_time_value = (typename 
PrimitiveTypeTraits<PType>::CppType&)(t);

Review Comment:
   ```suggestion
           const auto& date_time_value = assert_cast<typename 
PrimitiveTypeTraits<PType>::CppType&>(t);
   ```



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