HappenLee commented on code in PR #53734:
URL: https://github.com/apache/doris/pull/53734#discussion_r2234645832
##########
be/src/vec/runtime/time_value.h:
##########
@@ -34,10 +35,43 @@ class TimeValue {
constexpr static int64_t ONE_HOUR_MICROSECONDS = 60 *
ONE_MINUTE_MICROSECONDS;
constexpr static int64_t ONE_MINUTE_SECONDS = 60;
constexpr static int64_t ONE_HOUR_SECONDS = 60 * ONE_MINUTE_SECONDS;
+ constexpr static uint32_t MICROS_SCALE = 6;
+ constexpr static int64_t MAX_TIME =
+ 3024000LL * ONE_SECOND_MICROSECONDS - 1; // 840:00:00 - 1ms ->
838:59:59.999999
using TimeType = typename PrimitiveTypeTraits<TYPE_TIMEV2>::CppType;
using ColumnTime = vectorized::DataTypeTimeV2::ColumnType;
+ static int64_t round_time(TimeType value, uint32_t scale) {
+ auto time = (int64_t)value;
+ DCHECK(scale <= MICROS_SCALE);
+ int64_t factor = common::exp10_i64(6 - scale);
+ int64_t roundedValue = (time >= 0) ? (time + factor / 2) / factor *
factor
Review Comment:
rounded_value
--
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]