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 01:18:40 UTC
[GitHub] [incubator-doris] yiguolei commented on a diff in pull request #9574: [Bug] Fix timestamp_diff issue when timeunit is year and month
yiguolei commented on code in PR #9574:
URL: https://github.com/apache/incubator-doris/pull/9574#discussion_r874275574
##########
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:
Why not use to_int64 here? I find it will check the type of datetimevalue.
int64_t VecDateTimeValue::to_int64() const {
switch (_type) {
case TIME_TIME:
return to_time_int64();
case TIME_DATE:
return to_date_int64();
case TIME_DATETIME:
return to_datetime_int64();
default:
return 0;
}
}
Are you sure, that the value here is always with TIME_DATETIME type?
--
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