-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Internal error in CAST from Timestamp[us] #3922
Comments
there's no implementaton for casting timestamp to int32 in the current version. you can cast it to int64 for now (bigint) |
The fact this is reported as an internal error is not ideal. I will change the error type |
The root cause is that the arrow cast kernel doesn't support converting from timestamp --> int32 (as @waitingkuo mentions) To fix this we çould extend the support support in https://github.com/apache/arrow-rs/blob/c7f7606/arrow/src/compute/kernels/cast.rs#L253-L254 |
@alamb i think int32 isn't large enough for microsecond scale. ❯ select to_timestamp_micros(4294967295);
+--------------------------------------+
| totimestampmicros(Int64(4294967295)) |
+--------------------------------------+
| 1970-01-01 01:11:34.967295 |
+--------------------------------------+
1 row in set. Query took 0.000 seconds. |
So maybe a better error message is the best solution here |
Thank you all. |
@ike560 Cast does support timestamp to INT64, you can try |
Thanks @waitingkuo |
Close |
Describe the bug
The following error occurs in cast of timestamp.
Exception: Internal error: Unsupported CAST from Timestamp(Microsecond, None) to Int32. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker
To Reproduce
Exception Traceback (most recent call last)
Input In [5], in
4 sql = '''
5 WITH a AS
6 (SELECT
(...)
14 FROM a
15 '''
16 df = ctx.sql(sql)
---> 17 df.show()
Exception: Internal error: Unsupported CAST from Timestamp(Microsecond, None) to Int32. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker
Additional context
Latest version : datafusion 0.6.0 (python)
The text was updated successfully, but these errors were encountered: