You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[CALCITE-5447] Add DATE_TRUNC function (enabled in BigQuery library)
In order to keep redshift.iq (the Quidem test for the
Redshift dialect using the Babel parser) working, we ensure
that the Redshift variant of DATE_TRUNC (which has arguments
in a different order than the BigQuery variant) can still be
handled by the parser, even though we still cannot execute
it.
Closeapache#3009
Copy file name to clipboardexpand all lines: site/_docs/reference.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -544,6 +544,7 @@ DATABASE,
544
544
**DATE**,
545
545
DATETIME_INTERVAL_CODE,
546
546
DATETIME_INTERVAL_PRECISION,
547
+
DATE_TRUNC,
547
548
**DAY**,
548
549
DAYS,
549
550
**DEALLOCATE**,
@@ -2609,14 +2610,15 @@ semantics.
2609
2610
| b m p | CONCAT(string [, string ]*) | Concatenates two or more strings
2610
2611
| m | COMPRESS(string) | Compresses a string using zlib compression and returns the result as a binary string.
2611
2612
| p | CONVERT_TIMEZONE(tz1, tz2, datetime) | Converts the timezone of *datetime* from *tz1* to *tz2*
2612
-
| b | CURRENT_DATETIME([timezone]) | Returns the current time as a TIMESTAMP from *timezone*
2613
+
| b | CURRENT_DATETIME([ timeZone ]) | Returns the current time as a TIMESTAMP from *timezone*
2613
2614
| m | DAYNAME(datetime) | Returns the name, in the connection's locale, of the weekday in *datetime*; for example, it returns '星期日' for both DATE '2020-02-10' and TIMESTAMP '2020-02-10 10:10:10'
2614
2615
| b | DATE(string) | Equivalent to `CAST(string AS DATE)`
2615
2616
| p q | DATEADD(timeUnit, integer, datetime) | Equivalent to `TIMESTAMPADD(timeUnit, integer, datetime)`
2616
2617
| p q | DATEDIFF(timeUnit, datetime, datetime2) | Equivalent to `TIMESTAMPDIFF(timeUnit, datetime, datetime2)`
2617
2618
| q | DATEPART(timeUnit, datetime) | Equivalent to `EXTRACT(timeUnit FROM datetime)`
2618
2619
| b | DATE_FROM_UNIX_DATE(integer) | Returns the DATE that is *integer* days after 1970-01-01
2619
2620
| p | DATE_PART(timeUnit, datetime) | Equivalent to `EXTRACT(timeUnit FROM datetime)`
2621
+
| b | DATE_TRUNC(date, timeUnit) | Truncates *date* to the granularity of *timeUnit*, rounding to the beginning of the unit
2620
2622
| o | DECODE(value, value1, result1 [, valueN, resultN ]*[, default ]) | Compares *value* to each *valueN* value one by one; if *value* is equal to a *valueN*, returns the corresponding *resultN*, else returns *default*, or NULL if *default* is not specified
2621
2623
| p | DIFFERENCE(string, string) | Returns a measure of the similarity of two strings, namely the number of character positions that their `SOUNDEX` values have in common: 4 if the `SOUNDEX` values are same and 0 if the `SOUNDEX` values are totally different
2622
2624
| b | ENDS_WITH(string1, string2) | Returns whether *string2* is a suffix of *string1*
@@ -2667,10 +2669,10 @@ semantics.
2667
2669
| b | TIMESTAMP_MICROS(integer) | Returns the TIMESTAMP that is *integer* microseconds after 1970-01-01 00:00:00
2668
2670
| b | TIMESTAMP_MILLIS(integer) | Returns the TIMESTAMP that is *integer* milliseconds after 1970-01-01 00:00:00
2669
2671
| b | TIMESTAMP_SECONDS(integer) | Returns the TIMESTAMP that is *integer* seconds after 1970-01-01 00:00:00
2670
-
| b | TIMESTAMP_TRUNC(timestamp, timeUnit) | Truncates a *timestamp*value to the granularity of *timeUnit*. The *timestamp* value is always rounded to the beginning of the *timeUnit*.
2672
+
| b | TIMESTAMP_TRUNC(timestamp, timeUnit) | Truncates *timestamp* to the granularity of *timeUnit*, rounding to the beginning of the unit
2671
2673
| b | TIME_ADD(time, interval) | Adds *interval* to *time*, independent of any time zone
2672
2674
| b | TIME_DIFF(time, time2, timeUnit) | Returns the whole number of *timeUnit* between *time* and *time2*
2673
-
| b | TIME_TRUNC(time, timeUnit) | Truncates a *time*value to the granularity of *timeUnit*. The *time* value is always rounded to the beginning of timeUnit, which can be one of the following: MILLISECOND, SECOND, MINUTE, HOUR.
2675
+
| b | TIME_TRUNC(time, timeUnit) | Truncates *time* to the granularity of *timeUnit*, rounding to the beginning of the unit
2674
2676
| o p | TO_DATE(string, format) | Converts *string* to a date using the format *format*
2675
2677
| o p | TO_TIMESTAMP(string, format) | Converts *string* to a timestamp using the format *format*
2676
2678
| b o p | TRANSLATE(expr, fromString, toString) | Returns *expr* with all occurrences of each character in *fromString* replaced by its corresponding character in *toString*. Characters in *expr* that are not in *fromString* are not replaced
0 commit comments