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

Cast string to timestamp crash while we input time before 1970 with floating number second #3082

Closed
Tracked by #3148
waitingkuo opened this issue Aug 8, 2022 · 2 comments · Fixed by #3163
Closed
Tracked by #3148
Labels
bug Something isn't working

Comments

@waitingkuo
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

DataFusion CLI v10.0.0
❯ select cast('1969-01-01T00:00:00.1' as timestamp);
thread 'main' panicked at 'invalid or out-of-range datetime', /Users/willy/.cargo/registry/src/github.com-1ecc6299db9ec823/chrono-0.4.19/src/naive/datetime.rs:117:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

while this works

DataFusion CLI v10.0.0
❯ select cast('1969-01-01T00:00:00' as timestamp);
+------------------------------------------------------------------+
| CAST(Utf8("1969-01-01T00:00:00") AS Timestamp(Nanosecond, None)) |
+------------------------------------------------------------------+
| 1968-12-31 16:00:00                                              |
+------------------------------------------------------------------+

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

@waitingkuo waitingkuo added the bug Something isn't working label Aug 8, 2022
@turbo1912
Copy link
Contributor

Spent some time tracking this down, root of the problem was on the arrow side doing the conversions. This was not working properly for negative values.

Luckly it looks like it was fixed 4 days ago and in the 20.0.0 release;

apache/arrow-rs#2325

@waitingkuo
Copy link
Contributor Author

@turbo1912 thank you! i'll wait for 20.0.0 and write a test case to close this

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
2 participants