Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Add support for BigQuery's DATETIME_ADD/DATETIME_DIFF functions.
DATETIME_ADD(datetime, interval) can accept a timestamp (or a datetime, which is an alias for timestamp) for its first argument and an interval for its second. The output is the datetime that occurs interval after the provided datetime.
DATETIME_DIFF(datetime, datetime2, timeUnit) returns the whole number of timeUnit between datetime and datetime2, with the result being negative if datetime occurs before datetime2
Examples:
DATETIME_ADD(TIMESTAMP '2008-12-25 15:30:00', INTERVAL 5 MINUTE) would return: '2008-12-25 15:35:00'.
DATETIME_DIFF(DATETIME '2008-12-25 15:30:00', DATETIME '2008-12-26 15:30:00', DAY) would return: -1.
Attachments
Issue Links
- relates to
-
CALCITE-5575 Incorrect priority of builtinFunctionCallMethods in Parser.jj
- Closed
-
DRILL-8410 Upgrade to Calcite 1.34
- Closed
- links to