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

Mihai Budiu commented on CALCITE-6427:
--------------------------------------

The code doing the expansion is in StandardConvertletTable, e.g., 
expandVariance.

> Use a higher precision for DECIMAL intermediate results for some aggregate 
> functions like STDDEV
> ------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-6427
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6427
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.37.0
>            Reporter: Mihai Budiu
>            Priority: Minor
>
> Today aggregates like STDDEV are expanded into computations that use 
> intermediate results with the same type as the input values. Since STDDEV 
> squares values, this precision may prove insufficient. For DECIMAL values a 
> reasonable approach would be to use double the input precision and scale.
> This is also related to [CALCITE-6322], [CALCITE-4924], [CALCITE-6324]



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

Reply via email to