waitingkuo commented on issue #4876:
URL: 
https://github.com/apache/arrow-datafusion/issues/4876#issuecomment-1385096556

   Postgrseql's `extract` returns double precision (f64 for datafusion) and 
   `date_part` return numeric (decimal for datafusion)
   
   quoted from 
https://www.postgresql.org/docs/15/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT
   ```For historical reasons, the date_part function returns values of type 
double precision. This can result in a loss of precision in certain uses. Using 
extract is recommended instead.```
   
   the return type for extract is still float but not decimal yet, it's tracked 
here
   https://github.com/apache/arrow-datafusion/issues/3996
   
   It's pending since the Decimal type wasn't consistent yet. 
https://github.com/apache/arrow-datafusion/issues/3996#issuecomment-1296370693
   Is it recommended to change the return type now? @alamb  @tustvold 
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to