Skip to content

Commit

Permalink
fix: correct return of temporal add and subtract and add timezone par…
Browse files Browse the repository at this point in the history
…ameter (#337)

BREAKING CHANGE: (add/subtract)ing an interval to a timestamp_tz
now requires a time zone and returns a timestamp_tz
  • Loading branch information
rok authored Feb 23, 2023
1 parent 7d7ddf1 commit 1b184cc
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions extensions/functions_datetime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ scalar_functions:
return: i64
-
name: "add"
description: Add an interval to a date/time type.
description: >-
Add an interval to a date/time type.
Timezone strings must be as defined by IANA timezone database (https://www.iana.org/time-zones).
Examples: "Pacific/Marquesas", "Etc/GMT+1".
If timezone is invalid an error is thrown.
impls:
- args:
- name: x
Expand All @@ -48,7 +53,10 @@ scalar_functions:
value: timestamp_tz
- name: y
value: interval_year
return: timestamp
- name: timezone
description: Timezone string from IANA tzdb.
value: string
return: timestamp_tz
- args:
- name: x
value: date
Expand All @@ -66,7 +74,7 @@ scalar_functions:
value: timestamp_tz
- name: y
value: interval_day
return: timestamp
return: timestamp_tz
- args:
- name: x
value: date
Expand All @@ -91,7 +99,12 @@ scalar_functions:
return: interval_year
-
name: "subtract"
description: Subtract an interval from a date/time type.
description: >-
Subtract an interval from a date/time type.
Timezone strings must be as defined by IANA timezone database (https://www.iana.org/time-zones).
Examples: "Pacific/Marquesas", "Etc/GMT+1".
If timezone is invalid an error is thrown.
impls:
- args:
- name: x
Expand All @@ -105,6 +118,15 @@ scalar_functions:
- name: y
value: interval_year
return: timestamp_tz
- args:
- name: x
value: timestamp_tz
- name: y
value: interval_year
- name: timezone
description: Timezone string from IANA tzdb.
value: string
return: timestamp_tz
- args:
- name: x
value: date
Expand Down

0 comments on commit 1b184cc

Please sign in to comment.