[ 
https://issues.apache.org/jira/browse/CALCITE-6313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17828525#comment-17828525
 ] 

Norman Jordan commented on CALCITE-6313:
----------------------------------------

It looks like this can cause different results if the result is cast back to a 
double.
{code:java}
postgres=# SELECT POW(CAST(5.27 AS DECIMAL), CAST(2.1 AS DECIMAL));
        pow
--------------------
 32.794596513009434 {code}
{code:java}
postgres=# SELECT CAST(POW(CAST(5.27 AS DECIMAL), CAST(2.1 AS DECIMAL)) AS 
DOUBLE PRECISION);
        pow
-------------------
 32.79459651300943
{code}
The decimal result preserved more precision.

> Support PostgreSQL POW
> ----------------------
>
>                 Key: CALCITE-6313
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6313
>             Project: Calcite
>          Issue Type: Sub-task
>            Reporter: James Duong
>            Priority: Minor
>
> * Our existing implementation always returns double.
>  * PostgreSQL allows returning a numeric instead of a double when inputs are 
> numeric. Not sure if this makes sense though.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to