You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/05/17 02:21:57 UTC

[GitHub] [incubator-doris] SaintBacchus commented on a diff in pull request #9574: [Bug] Fix timestamp_diff issue when timeunit is year and month

SaintBacchus commented on code in PR #9574:
URL: https://github.com/apache/incubator-doris/pull/9574#discussion_r874299512


##########
be/src/vec/runtime/vdatetime_value.h:
##########
@@ -288,21 +288,23 @@ class VecDateTimeValue { // Now this type is a temp solution with little changes
         case YEAR: {
             int year = (ts_value2.year() - ts_value1.year());
             if (year > 0) {
-                year -= (ts_value2.to_int64() % 10000000000 - ts_value1.to_int64() % 10000000000) <
-                        0;
+                year -= (ts_value2.to_datetime_int64() % 10000000000 -

Review Comment:
   Because the logic of `% 10000000000` is depend on `datetime` type.
   If the type is `date`, this logic should be like this `(ts_value2.to_int64() % 10000 - ts_value1.to_int64() % 10000) < 0`



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org