imay commented on a change in pull request #1598: Time zone related be function
URL: https://github.com/apache/incubator-doris/pull/1598#discussion_r312721714
##########
File path: be/src/runtime/datetime_value.h
##########
@@ -435,7 +436,8 @@ class DateTimeValue {
}
int64_t second_diff(const DateTimeValue& rhs) const {
- return unix_timestamp() - rhs.unix_timestamp();
+ return unix_timestamp(TimezoneDatabase::default_time_zone)
+ - rhs.unix_timestamp(TimezoneDatabase::default_time_zone);
Review comment:
For second_diff which is a literal compare, I think we should not introduce
timezone. Which can bring some cost which isn't needed. Such as search if
timezone exists.
And I think we can introduce another seconds such as seconds from 0000-01-01
00:00:00, which has no relation with time zone.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]