Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect type coercion rule for date + interval #3093

Closed
waitingkuo opened this issue Aug 10, 2022 · 3 comments
Closed

Incorrect type coercion rule for date + interval #3093

waitingkuo opened this issue Aug 10, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@waitingkuo
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

coercion rule for date + interval('1 day' ) works but fails for hours/min/sec

To Reproduce
Steps to reproduce the behavior:

select now()::date + interval '1 hour';
+----------------------------------------------------+
| CAST(now() AS Date32) + IntervalDayTime("3600000") |
+----------------------------------------------------+
| +11879-01-27                                       |
+----------------------------------------------------+
1 row in set. Query took 0.000 seconds.

Expected behavior
A clear and concise description of what you expected to happen.

Cast to Timestamp like what postgresql does

willy=# select now()::date + interval '1 hour';
      ?column?       
---------------------
 2022-08-10 01:00:00
(1 row)

Additional context
Add any other context about the problem here.

@waitingkuo waitingkuo added the bug Something isn't working label Aug 10, 2022
@waitingkuo
Copy link
Contributor Author

related issue/pr: #194 #2235

@JasonLi-cn
Copy link
Contributor

My reproduce

select now()::date + interval '1 hour';
+----------------------------------------------------+
| CAST(now() AS Date32) + IntervalDayTime("3600000") |
+----------------------------------------------------+
| 2022-08-12                                         |
+----------------------------------------------------+

@waitingkuo
Copy link
Contributor Author

@JasonLi-cn thank you, looks like this is solved in some pr. I'll close this issue as this is similar as #3103 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants