lide-reed commented on code in PR #26154: URL: https://github.com/apache/doris/pull/26154#discussion_r1380005147
########## be/src/vec/runtime/vdatetime_value.h: ########## @@ -1316,8 +1316,8 @@ int64_t datetime_diff(const DateV2Value<T0>& ts_value1, const DateV2Value<T1>& t int month = (ts_value2.year() - ts_value1.year()) * 12 + (ts_value2.month() - ts_value1.month()); if constexpr (std::is_same_v<T0, T1>) { - int shift_bits = DateV2Value<T0>::is_datetime ? DATETIMEV2_YEAR_WIDTH + 5 - : DATEV2_YEAR_WIDTH + 5; + int shift_bits = DateV2Value<T0>::is_datetime ? DATETIMEV2_YEAR_WIDTH + 4 + : DATEV2_YEAR_WIDTH + 4; Review Comment: Can you define a const variable to show its real meaning for the magic 4? -- 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-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org