Skip to content

Commit

Permalink
[CALCITE-1827] Document TIMESTAMPADD and TIMESTAMPDIFF functions (Sun…
Browse files Browse the repository at this point in the history
…Jincheng)

Close apache#466
  • Loading branch information
sunjincheng121 authored and julianhyde committed Jun 6, 2017
1 parent 419b810 commit f5df5dd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions site/_docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1144,25 +1144,22 @@ Not implemented:
| HOUR(date) | Equivalent to `EXTRACT(HOUR FROM date)`. Returns an integer between 0 and 23.
| MINUTE(date) | Equivalent to `EXTRACT(MINUTE FROM date)`. Returns an integer between 0 and 59.
| SECOND(date) | Equivalent to `EXTRACT(SECOND FROM date)`. Returns an integer between 0 and 59.
| TIMESTAMPADD(timeUnit, integer, datetime) | Returns *datetime* with an interval of (signed) *integer* *timeUnit*s added. Equivalent to `datetime + INTERVAL 'integer' timeUnit`
| TIMESTAMPDIFF(timeUnit, datetime, datetime2) | Returns the (signed) number of *timeUnit* intervals between *datetime* and *datetime2*. Equivalent to `(datetime2 - datetime) timeUnit`

Calls to niladic functions such as `CURRENT_DATE` do not accept parentheses in
standard SQL. Calls with parentheses, such as `CURRENT_DATE()` are accepted in certain
[conformance levels]({{ site.apiRoot }}/org/apache/calcite/sql/validate/SqlConformance.html#allowNiladicParentheses--).

Not implemented:

* EXTRACT(timeUnit FROM interval)
* CEIL(interval)
* FLOOR(interval)
* datetime - datetime timeUnit [ TO timeUnit ]
* interval OVERLAPS interval
* \+ interval
* \- interval
* interval + interval
* interval - interval
* interval / interval
* datetime + interval
* datetime - interval

### System functions

Expand Down

0 comments on commit f5df5dd

Please sign in to comment.