Skip to content

Commit fa7469c

Browse files
committed
fix(extensions)!: correct return type for subtract:date_iday operation
Signed-off-by: Niels Pardon <par@zurich.ibm.com>
1 parent 7cceb83 commit fa7469c

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

extensions/functions_datetime.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ scalar_functions:
463463
value: date
464464
- name: y
465465
value: interval_day<P>
466-
return: date
466+
return: precision_timestamp<P>
467467
-
468468
name: "lte"
469469
description: less than or equal to

tests/cases/datetime/subtract_datetime.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
### SUBSTRAIT_INCLUDE: '/extensions/functions_datetime.yaml'
33

44
# timestamps: examples using the timestamp type
5-
subtract('2016-12-31T13:30:15'::ts, 'P5D'::iday) = '2016-12-26T13:30:15'::ts
5+
subtract('2016-12-31T13:30:15'::ts, 'P5D'::iday<0>) = '2016-12-26T13:30:15'::ts
66
subtract('2016-12-01T13:30:15'::ts, 'P5Y'::iyear) = '2011-12-01T13:30:15'::ts
7-
subtract('2016-12-01T13:30:15'::ts, 'PT5H'::iday) = '2016-12-01T08:30:15'::ts
7+
subtract('2016-12-01T13:30:15'::ts, 'PT5H'::iday<0>) = '2016-12-01T08:30:15'::ts
88

99
# date: examples using the date type
10-
subtract('2020-12-31'::date, 'P5D'::iday) = '2020-12-26'::date
10+
subtract('2020-12-31'::date, 'P5D'::iday<0>) = '2020-12-26T00:00:00'::pts?<0>
1111
subtract('2020-12-31'::date, 'P5Y'::iyear) = '2015-12-31'::date
1212
subtract('2020-12-31'::date, 'P5M'::iyear) = '2020-07-31'::date
1313

1414
# null_input: examples with null args or return
15-
subtract(null::date?, 'P5D'::iday) = null::date?
15+
subtract(null::date?, 'P5D'::iday<0>) = null::pts?<0>

0 commit comments

Comments
 (0)