You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Danny Chen (Jira)" <ji...@apache.org> on 2020/02/21 03:54:00 UTC

[jira] [Commented] (CALCITE-3717) Query fails with "division by zero" exception

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

Danny Chen commented on CALCITE-3717:
-------------------------------------

Seems not possible to be check in for version 1.22. Let's move this to 1.23.

> Query fails with "division by zero" exception
> ---------------------------------------------
>
>                 Key: CALCITE-3717
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3717
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.21.0
>            Reporter: Hank Miller
>            Assignee: Feng Zhu
>            Priority: Major
>             Fix For: 1.23.0
>
>
> Hi, community. We use Calcite-1.21 to connect and compute data resident in PostgreSQL and MySQL. It works pretty well. But we encountered a problem yesterday.
> Firstly, we combine data from different datasources.
> Assume the combined table is _T(...., c1, c2, c3)_, in which _c1, c2, c3_ are integer columns. Then according to our business logic, we need to perform further data processing in Calcite.
> {code:java}
> select case when c1=0 then ..
>             when c2=0 then 1.0/c1 + ...
>             when c3=0 then 1.0/c1 + 1.0/c2 + ...
>        else -99.99 end 
> from T{code}
> However, the query throws "java.lang.ArithmeticException: Division by zero".
> Anything goes wrong?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)