[ 
https://issues.apache.org/jira/browse/CALCITE-280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Hyde updated CALCITE-280:
--------------------------------
    Summary: BigDecimal underflow  (was: avg() on BigDecimal may cause 
java.lang.ArithmeticException: Non-terminating decimal expansion; no exact 
representable decimal result.)

> BigDecimal underflow
> --------------------
>
>                 Key: CALCITE-280
>                 URL: https://issues.apache.org/jira/browse/CALCITE-280
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: GitHub Import
>              Labels: github-import
>
> avg() on BigDecimal column hits SqlFunctions.divide(BigDeciaml, BigDecimal), 
> which further calls BigDecimal.divide(BigDecimal). This method will throw 
> exception when the result has infinite digits after the decimal point, e.g. 
> 10/9=1.11111...
> Alternatively, divide(BigDecimal divisor, MathContext mc) should be called 
> instead, so BigDecimal knows the precision and rounding mode to handle the 
> infinite number.
> ---------------- Imported from GitHub ----------------
> Url: https://github.com/julianhyde/optiq/issues/280
> Created by: [liyang-gmt8|https://github.com/liyang-gmt8]
> Labels: 
> Created at: Mon May 12 10:25:07 CEST 2014
> State: open



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to