You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/01 11:01:41 UTC

[GitHub] [arrow-datafusion] waitingkuo opened a new issue, #2998: Double to_timestamp_seconds gets abnormal result

waitingkuo opened a new issue, #2998:
URL: https://github.com/apache/arrow-datafusion/issues/2998

   **Describe the bug**
   
   
   **To Reproduce**
   
   ```bash
   ❯ select to_timestamp_seconds(a) from (select to_timestamp_seconds(1) as a)A;
   +-------------------------+
   | totimestampseconds(a.a) |
   +-------------------------+
   | 1969-12-31 16:00:01     |
   +-------------------------+
   1 row in set. Query took 0.000 seconds.
   ```
   
   while ```to_timestamp_millis``` will make it crash
   
   ```bash
   ❯ select to_timestamp_millis(a) from (select to_timestamp_millis(1) as a)A;
   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
   ```
   
   **Expected behavior**
   it should return 1970-01-01 00:00:01 . It feel likes that timezone conversion is applied somewhere. (I'm in UTC+8)
   
   **Additional context**
   
   


-- 
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: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] waitingkuo commented on issue #2998: Double to_timestamp_seconds produces abnormal result

Posted by GitBox <gi...@apache.org>.
waitingkuo commented on issue #2998:
URL: https://github.com/apache/arrow-datafusion/issues/2998#issuecomment-1201334435

   the subquery return something like `1970-01-01T00:00:00` (without the endding Z as utc ) which will be deem as local-time (UTC+8) while parsing by <https://docs.rs/arrow/19.0.0/arrow/compute/kernels/cast_utils/fn.string_to_timestamp_nanos.html#timezone--offset-handling>  


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb closed issue #2998: Double to_timestamp_seconds produces abnormal result

Posted by GitBox <gi...@apache.org>.
alamb closed issue #2998: Double to_timestamp_seconds produces abnormal result
URL: https://github.com/apache/arrow-datafusion/issues/2998


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org