Mryange commented on code in PR #51475:
URL: https://github.com/apache/doris/pull/51475#discussion_r2136785834


##########
be/src/vec/data_types/data_type_date_or_datetime_v2.h:
##########
@@ -168,6 +175,14 @@ class DataTypeDateTimeV2 final : public 
DataTypeNumberBase<PrimitiveType::TYPE_D
     static void cast_from_date(const Int64 from, UInt64& to);
     static void cast_from_date_time(const Int64 from, UInt64& to);
 
+    static UInt64 get_year(const UInt64 v) { return (v & YEAR_PART) >> 46; }
+    static UInt64 get_month(const UInt64 v) { return (v & MONTH_PART) >> 42; }
+    static UInt64 get_day(const UInt64 v) { return (v & DAY_PART) >> 37; }
+    static UInt64 get_hour(const UInt64 v) { return (v & HOUR_PART) >> 32; }
+    static UInt64 get_minute(const UInt64 v) { return (v & MINUTE_PART) >> 26; 
}
+    static UInt64 get_second(const UInt64 v) { return (v & SECOND_PART) >> 20; 
}

Review Comment:
   用 vdatetime_value.h 里面的hour(),minute(),second()吧。



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