Repository navigation
DOCS-163: Docs for the Interval data type and the INTERVAL operator. - #7452
Merged
BayoNet merged 46 commits intoNov 6, 2019
Merged
Conversation
…s/CLICKHOUSEDOCS-163-interval
blinkov
suggested changes
Oct 31, 2019
| @@ -0,0 +1,74 @@ | |||
| # Interval {#data-type-interval} | |||
|
|
|||
| Represents time and date intervals. The resulting type of the `INTERVAL` operator. | |||
| - QUARTER | ||
| - YEAR | ||
|
|
||
| For each interval type, there is the separated data type. For example, the DAY interval is expressed as the `IntervalDay` data type: |
Contributor
There was a problem hiding this comment.
I think we'd better explicitly explain that this as a set of similarly behaving data types from the very beginning
|
|
||
| Structure: | ||
|
|
||
| - Unsigned integer value of interval. |
Contributor
There was a problem hiding this comment.
- value -> length?
- from this explanation it's not obvious that each interval value means "this integer multiplied by the unit from interval time"
| └─────────────────────┴───────────────────────────────┘ | ||
| ``` | ||
|
|
||
| Intervals of different types can't be combined in one `INTERVAL` operator. You can't use the expressions like `INTERVAL 4 DAY 1 HOUR`, so you need to express intervals in the minimal units. For example, `1 day and an hour` interval should be expressed as `INTERVAL 25 HOUR`. |
Contributor
There was a problem hiding this comment.
- this is important and should be explained earlier, probably in !!! block, but not in terms of INTERVAL operator, but in terms of Interval values
- minimal units = SECOND, it's more like "smallest unit it consists of"
| ### INTERVAL {#operator-interval} | ||
|
|
||
| Creates an [Interval](../data_types/special_data_types/interval.md)-type value that should be used in arithmetical operations with [Date](../data_types/date.md) and [DateTime](../data_types/datetime.md)-type values. | ||
|
|
Contributor
There was a problem hiding this comment.
it has pretty non-trivial syntax that needs explanation
some details from Interval type article also are worth repeating here
Co-Authored-By: Ivan Blinkov <[email protected]>
BayoNet
added a commit
that referenced
this pull request
Dec 6, 2019
* Update operators.md (#70) * Update operators.md (#71) * CLICKHOUSEDOCS-163: EN review, RU translation. * CLICKHOUSEDOCS-163: Fix * Update docs/ru/data_types/special_data_types/interval.md Co-Authored-By: Ivan Blinkov <[email protected]> * Update docs/ru/query_language/operators.md Co-Authored-By: Ivan Blinkov <[email protected]> * Update docs/ru/data_types/special_data_types/interval.md Co-Authored-By: Ivan Blinkov <[email protected]> * CLICKHOUSEDOCS-163: Clarification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Category (leave one):