-
Notifications
You must be signed in to change notification settings - Fork 546
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
Add numeric
overload for math functions
#15632
Comments
Interesting .... I think most of the mathematical scalar functions are only implemented for primitive numerics:
cr> SELECT abs(power(2,7)::NUMERIC);
SQLParseException[Cannot cast `128.0` of type `numeric` to type `byte`]
cr> SELECT abs(power(2,6)::NUMERIC);
+----+
| 64 |
+----+
| 64 |
+----+
SELECT 1 row in set (0.008 sec) |
Right SELECT abs(127::NUMERIC);
> 127
SELECT abs(128::NUMERIC);
> SQLParseException[Cannot cast `128` of type `numeric` to type `byte`]
SELECT ceil(128::NUMERIC);
> SQLParseException[Cannot cast `128` of type `numeric` to type `byte`]
SELECT ceil(128::INTEGER);
> 128
|
Thanks for reporting and further investigating @surister @proddata . I also think that we need to add |
Confirmed: |
This leads to breaking changes, for example |
number
of type numeric into bytenumeric
overload for math functions
CrateDB version
5.5.2, 5.6.2
CrateDB setup information
I think it's not relevant.
Steps to Reproduce
Actual Result
SQLParseException[Cannot cast
1.7320508075688772
of typenumeric
to typebyte
Expected Result
1.7320508075688772
(This query runs fine in Postgres)The text was updated successfully, but these errors were encountered: