You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "waitingkuo (via GitHub)" <gi...@apache.org> on 2023/03/27 07:13:03 UTC

[GitHub] [arrow-datafusion] waitingkuo opened a new issue, #5750: `date_trunc` always returns `Timestamp(Nanosecond, None)`

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

   ### Describe the bug
   
   while i try to use `date_trunc` to `Timestamp(Second, None)`, it returns `Timestamp(Nanosecond, None)`
   
   ```bash
   ❯ select date_trunc('minute', to_timestamp_seconds(61));
   +---------------------------------------------------------+
   | datetrunc(Utf8("minute"),totimestampseconds(Int64(61))) |
   +---------------------------------------------------------+
   | 1970-01-01T00:01:00                                     |
   +---------------------------------------------------------+
   1 row in set. Query took 0.003 seconds.
   
   ❯ select arrow_typeof(date_trunc('minute', to_timestamp_seconds(61)));
   +----------------------------------------------------------------------+
   | arrowtypeof(datetrunc(Utf8("minute"),totimestampseconds(Int64(61)))) |
   +----------------------------------------------------------------------+
   | Timestamp(Nanosecond, None)                                          |
   +----------------------------------------------------------------------+
   1 row in set. Query took 0.003 seconds.
   ```
   
   The behavior is similar while I apply `date_trunc` to Timestamp with Millis and Micros.
   
   ### To Reproduce
   
   ```bash
   ❯ select arrow_typeof(date_trunc('minute', to_timestamp_seconds(61)));
   +----------------------------------------------------------------------+
   | arrowtypeof(datetrunc(Utf8("minute"),totimestampseconds(Int64(61)))) |
   +----------------------------------------------------------------------+
   | Timestamp(Nanosecond, None)                                          |
   +----------------------------------------------------------------------+
   1 row in set. Query took 0.003 seconds.
   ```
   
   ### Expected behavior
   
   ```bash
   ❯ select arrow_typeof(date_trunc('minute', to_timestamp_seconds(61)));
   +----------------------------------------------------------------------+
   | arrowtypeof(datetrunc(Utf8("minute"),totimestampseconds(Int64(61)))) |
   +----------------------------------------------------------------------+
   | Timestamp(Second, None)                                          |
   +----------------------------------------------------------------------+
   1 row in set. Query took 0.003 seconds.
   ```
   
   ### 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: github-unsubscribe@arrow.apache.org.apache.org

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


[GitHub] [arrow-datafusion] Weijun-H commented on issue #5750: `date_trunc` always returns `Timestamp(Nanosecond, None)`

Posted by "Weijun-H (via GitHub)" <gi...@apache.org>.
Weijun-H commented on issue #5750:
URL: https://github.com/apache/arrow-datafusion/issues/5750#issuecomment-1488888635

   Could I pick this ticket?


-- 
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 #5750: `date_trunc` always returns `Timestamp(Nanosecond, None)`

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #5750: `date_trunc` always returns `Timestamp(Nanosecond, None)`
URL: https://github.com/apache/arrow-datafusion/issues/5750


-- 
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] waitingkuo commented on issue #5750: `date_trunc` always returns `Timestamp(Nanosecond, None)`

Posted by "waitingkuo (via GitHub)" <gi...@apache.org>.
waitingkuo commented on issue #5750:
URL: https://github.com/apache/arrow-datafusion/issues/5750#issuecomment-1491804327

   hi @Weijun-H sure please take it, thank you


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