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/10/28 14:05:09 UTC

[GitHub] [arrow-datafusion] waitingkuo opened a new issue, #3996: change `extract` return types to decimal

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

   extract currently returns i32 which might loss some information
   
   ```bash
   ❯ select extract(second from timestamp '2000-01-01T00:00:00.1');
   +--------------------------------------------------------+
   | datepart(Utf8("SECOND"),Utf8("2000-01-01T00:00:00.1")) |
   +--------------------------------------------------------+
   | 0                                                      |
   +--------------------------------------------------------+
   1 row in set. Query took 0.000 seconds.
   ```
   
   while postgresql returns decimal
   
   ```bash
   willy=# select extract(second from timestamp '2000-01-01T00:00:00.1');
    extract  
   ----------
    0.100000
   (1 row)
   ```
   
   
   
   
   **Describe the solution you'd like**
   A clear and concise description of what you want to happen.
   
   change it to decimal
   
   **Describe alternatives you've considered**
   A clear and concise description of any alternative solutions or features you've considered.
   
   **Additional context**
   Add any other context or screenshots about the feature request here.
   


-- 
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] tustvold commented on issue #3996: change `extract` return types to decimal

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

   This likely will want to wait until decimal support is more consistent - see #4036 


-- 
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] comphead commented on issue #3996: change `extract` return types to decimal

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

   @waitingkuo looks like #4385 will address this ticket? Tests return seconds as floats


-- 
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 #3996: change `extract` return types to decimal

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

   @comphead this is to align with postgresql to output decimal  instead of decimal which could prevent something like this
   ```bash
   ❯ select date_part('millisecond', timestamp '2000-01-01T00:00:09.123456');
   +------------------------------------------------------------------+
   | datepart(Utf8("millisecond"),Utf8("2000-01-01T00:00:09.123456")) |
   +------------------------------------------------------------------+
   | 9123.455999999998                                                |
   +------------------------------------------------------------------+
   1 row in set. Query took 0.002 seconds.
   ```
   note that this datafusion-cli is from the `date_part_f64` branch


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