Skip to content

Commit

Permalink
feat: change temporal add and subtract
Browse files Browse the repository at this point in the history
  • Loading branch information
rok committed Jan 16, 2023
1 parent 431651e commit 34d2300
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 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 not present then UTC is assumed. If timezone is invalid an error is thrown.
impls:
- args:
- name: x
Expand All @@ -48,7 +53,11 @@ scalar_functions:
value: timestamp_tz
- name: y
value: interval_year
return: timestamp
- name: timezone
constant: true
description: Timezone string from IANA tzdb.
value: string
return: timestamp_tz
- args:
- name: x
value: date
Expand All @@ -66,7 +75,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 +100,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 not present then UTC is assumed. If timezone is invalid an error is thrown.
impls:
- args:
- name: x
Expand All @@ -105,6 +119,16 @@ scalar_functions:
- name: y
value: interval_year
return: timestamp_tz
- args:
- name: x
value: timestamp_tz
- name: y
value: interval_year
- name: timezone
constant: true
description: Timezone string from IANA tzdb.
value: string
return: timestamp_tz
- args:
- name: x
value: date
Expand Down

0 comments on commit 34d2300

Please sign in to comment.