andygrove opened a new issue, #10315:
URL: https://github.com/apache/datafusion/issues/10315
### Is your feature request related to a problem or challenge?
DataFusion supports casting the string `4e7` to float but not to decimal.
This is inconsistent with Postgres (and Apache Spark).
## Postgres
```
postgres=# select cast('4e7' as float);
float8
----------
40000000
(1 row)
postgres=# select cast('4e7' as decimal(10,2));
numeric
-------------
40000000.00
```
## DataFusion
```
DataFusion CLI v37.0.0
❯ select cast('4e7' as float);
+-------------+
| Utf8("4e7") |
+-------------+
| 40000000.0 |
+-------------+
1 row in set. Query took 0.010 seconds.
❯ select cast('4e7' as decimal(10,2));
Arrow error: Cast error: Cannot cast string '4e7' to value of Decimal128(38,
10) type
```
### Describe the solution you'd like
_No response_
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]