alamb opened a new issue, #4512:
URL: https://github.com/apache/arrow-rs/issues/4512
**Describe the bug**
Cannot cast string '2021-01-02' to value of Date64 type
I can cast it to `Date32` type for some reason
**To Reproduce**
This is using `datafusion-cli`
```
❯ select arrow_cast('2021-1-2', 'Date64');
Optimizer rule 'simplify_expressions' failed
caused by
Arrow error: Cast error: Cannot cast string '2021-1-2' to value of Date64
type
❯ select arrow_cast('2021-1-2', 'Date32');
+------------------+
| Utf8("2021-1-2") |
+------------------+
| 2021-01-02 |
+------------------+
1 row in set. Query took 0.000 seconds.
```
I found a workaround to cast the string first to `Date32` and then `Date64`
❯ select arrow_cast(arrow_cast('2021-1-2', 'Date32'), 'Date64');
+---------------------+
| Utf8("2021-1-2") |
+---------------------+
| 2021-01-02T00:00:00 |
+---------------------+
1 row in set. Query took 0.000 seconds.
```
**Expected behavior**
I expect to be able to parse '2021-01-02' successfully as Date64
**Additional context**
<!--
Add any other context about the problem here.
-->
--
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]