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

[CLICKHOUSE-1791] add modulo for Date and DateTime #3385

Merged
merged 5 commits into from
Oct 22, 2018

Conversation

VadimPlh
Copy link
Contributor

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

@alexey-milovidov
Copy link
Member

DateTime?

@VadimPlh VadimPlh changed the title CLICKHOUSE-1791 add modulo for date CLICKHOUSE-1791 add modulo for Date and DateTime Oct 15, 2018
@VadimPlh VadimPlh changed the title CLICKHOUSE-1791 add modulo for Date and DateTime [CLICKHOUSE-1791] add modulo for Date and DateTime Oct 15, 2018
/// Date % Int32 -> int32
Case<std::is_same_v<Op, ModuloImpl<T0, T1>>, Switch<
Case<IsDateOrDateTime<LeftDataType> && IsIntegral<RightDataType>, RightDataType>,
Case<IsDateOrDateTime<LeftDataType> && IsNonIntegral<RightDataType>, DataTypeInt32>>>>;
Copy link
Member

Choose a reason for hiding this comment

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

!IsIntegral?

@@ -0,0 +1,12 @@
SELECT toDate('21-06-2018') % 234 = toInt16(toDate('21-06-2018')) % 234;
Copy link
Member

Choose a reason for hiding this comment

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

toDate('21-06-2018') doesn't work as you expect.

@alexey-milovidov alexey-milovidov merged commit 57e6dc3 into ClickHouse:master Oct 22, 2018
alexey-milovidov added a commit that referenced this pull request Oct 23, 2018
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