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/03/11 14:10:32 UTC

[GitHub] [arrow-datafusion] liukun4515 opened a new issue #1992: The return type of EXTRACT

liukun4515 opened a new issue #1992:
URL: https://github.com/apache/arrow-datafusion/issues/1992


   I think the result type of u32 is not enough.
   From the spark, 
   ```
   spark-sql> SELECT EXTRACT(YEAR FROM TIMESTAMP '-2000-12-16 12:21:13');
   -2000
   ```
   But this is not related to this issue, I will open a follow up pull request and discuss the returned type.
   
   _Originally posted by @liukun4515 in https://github.com/apache/arrow-datafusion/pull/1991#r824743599_


-- 
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] Ted-Jiang commented on issue #1992: The return type of EXTRACT

Posted by GitBox <gi...@apache.org>.
Ted-Jiang commented on issue #1992:
URL: https://github.com/apache/arrow-datafusion/issues/1992#issuecomment-1066596924


   Do we  need support negative timestamp or date?


-- 
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] Ted-Jiang commented on issue #1992: The return type of EXTRACT

Posted by GitBox <gi...@apache.org>.
Ted-Jiang commented on issue #1992:
URL: https://github.com/apache/arrow-datafusion/issues/1992#issuecomment-1066603568


   PG not support negative timestamp
   ```
   postgres@33a4a5d969c0:/$ psql
   psql (13.5 (Debian 13.5-1.pgdg110+1))
   Type "help" for help.
   
   postgres=# SELECT EXTRACT(YEAR  FROM TIMESTAMP '-2001-02-16 20:38:40');
   ERROR:  time zone displacement out of range: "-2001-02-16 20:38:40"
   LINE 1: SELECT EXTRACT(YEAR  FROM TIMESTAMP '-2001-02-16 20:38:40');
   ```


-- 
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] liukun4515 commented on issue #1992: The return type of EXTRACT

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


   now we can leave this issue and keep discussion it.


-- 
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] liukun4515 commented on issue #1992: The return type of EXTRACT

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


   because i hit this document from PG https://www.postgresql.org/docs/14/functions-datetime.html and it points out that
   "The extract function returns values of type `numeric`. The following are valid field names" 
   
   other point from the definition
   ```
   extract ( field from timestamp ) → numeric
   
   Get timestamp subfield; see [Section 9.9.1](https://www.postgresql.org/docs/14/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT)
   
   extract(hour from timestamp '2001-02-16 20:38:40') → 20
   ```


-- 
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] xudong963 commented on issue #1992: The return type of EXTRACT

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


   I don't think we need to support negative timestamp.


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