Skip to content

Commit

Permalink
fix: date - interval sqlness (#2912)
Browse files Browse the repository at this point in the history
fix: date - interval can work
  • Loading branch information
QuenKar authored Dec 12, 2023
1 parent 880ca2e commit 9531469
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
22 changes: 20 additions & 2 deletions tests/cases/standalone/common/types/interval/interval.result
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,26 @@ SELECT DATE '2000-10-30' + interval_value from intervals;
+-----------------------------------------------+

-- DATE - INTERVAL
-- Run failed in distributed mode, but passed in standalone mode:
-- SELECT DATE '2000-10-30' - interval_value from intervals;
SELECT DATE '2000-10-30' - interval_value from intervals;

+-----------------------------------------------+
| Utf8("2000-10-30") - intervals.interval_value |
+-----------------------------------------------+
| 1999-10-30 |
| 1999-10-30 |
| 1998-08-30 |
| 1997-10-30 |
| 1996-10-30 |
| 1995-10-30 |
| 1994-10-30 |
| 1993-10-30 |
| 1992-10-30 |
| 1991-10-21 |
| 1990-10-30 |
| 1989-10-19 |
| 1988-10-18 |
+-----------------------------------------------+

-- INTERVAL + TIMESTAMP CONSTANT
SELECT TIMESTAMP '1992-09-20 11:30:00.123456' + interval_value as new_value from intervals;

Expand Down
3 changes: 1 addition & 2 deletions tests/cases/standalone/common/types/interval/interval.sql
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ SELECT ts - interval_value as new_value from intervals;
SELECT DATE '2000-10-30' + interval_value from intervals;

-- DATE - INTERVAL
-- Run failed in distributed mode, but passed in standalone mode:
-- SELECT DATE '2000-10-30' - interval_value from intervals;
SELECT DATE '2000-10-30' - interval_value from intervals;

-- INTERVAL + TIMESTAMP CONSTANT
SELECT TIMESTAMP '1992-09-20 11:30:00.123456' + interval_value as new_value from intervals;
Expand Down

0 comments on commit 9531469

Please sign in to comment.