Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function toStartOfTenMinutes(). #4298

Merged

Conversation

vitlibar
Copy link
Member

@vitlibar vitlibar commented Feb 6, 2019

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

#4293

@vitlibar vitlibar merged commit 7ff5439 into ClickHouse:master Feb 7, 2019
@vitlibar vitlibar deleted the add-function-to-start-of-ten-minutes branch February 7, 2019 08:46
@@ -284,6 +284,15 @@ class DateLUTImpl
inline time_t toStartOfFiveMinute(time_t t) const { return t / 300 * 300; }
inline time_t toStartOfFifteenMinutes(time_t t) const { return t / 900 * 900; }

inline time_t toStartOfTenMinutes(time_t t) const
{
if (offset_is_whole_number_of_hours_everytime)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's guaranteed that the offset is divisable by 15 minutes for all time zones since some reasonable year.
You can avoid this check.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation looks inconsistent with two functions above.

Copy link
Member Author

@vitlibar vitlibar Feb 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #4304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants