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 error for plus/minus operations over timestamps and dates #4420

Closed
Tracked by #3148
DDtKey opened this issue Nov 29, 2022 · 0 comments · Fixed by #4662
Closed
Tracked by #3148

Incorrect error for plus/minus operations over timestamps and dates #4420

DDtKey opened this issue Nov 29, 2022 · 0 comments · Fixed by #4662
Labels
bug Something isn't working

Comments

@DDtKey
Copy link
Contributor

DDtKey commented Nov 29, 2022

Describe the bug

If you would try to perform plus/minus operation over dates/timestamps inside SQL it will return an error:
X - Y can't be evaluated because there isn't a common type to coerce the types to

It looks incorrect to me, it's more about unsupported operations (it works only with intervals), not coercion itself.

Moreover it confuses me, because it could be the same types and error doesn't report the relevant reason.

To Reproduce
Just write SQL with this unsupported operation, like:
select now() - now() from x

Expected behavior
It should returns clear error, like: the Timestamp - Timestamp is unsupported operation

Additional context
Here the current logic is: Link to the related code

@DDtKey DDtKey added the bug Something isn't working label Nov 29, 2022
@DDtKey DDtKey changed the title Incorrect error for timestampt and date plus/minus operations Incorrect error for plus/minus operations over timestamps and dates Nov 29, 2022
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

Successfully merging a pull request may close this issue.

1 participant