You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tajo.apache.org by "Hyunsik Choi (JIRA)" <ji...@apache.org> on 2014/07/29 05:01:49 UTC

[jira] [Comment Edited] (TAJO-979) Dividing float value by zero should throw "Divide by zero Exception"

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

Hyunsik Choi edited comment on TAJO-979 at 7/29/14 3:01 AM:
------------------------------------------------------------

In my view, most of uses may not want to abort queries which faces 'divide by zero'. Of course, it can be avoided if users use conditional expression like CASE WHEN. However, It does not make sense to force users to make use of some condition expression for all divide expressions. So, 'divide by zero' exception should return NULL.

In addition, we can show some warning about how many 'divide by zero' occurs. Also, we could add some session variable to control query behavior to abort or ignore.


was (Author: hyunsik):
In my view, most of uses may not want to abort queries which faces 'divide by zero'. Of course, it can be avoided if users use conditional expression like CASE WHEN. However, It does not make sense to force users to make use of some condition expression for all divide expressions. divide by zero exception should return NULL.

In addition, we can show some warning about how many 'divide by zero' occurs. Also, we could add some session variable to control query behavior to abort or ignore.

> Dividing float value by zero should throw "Divide by zero Exception"
> --------------------------------------------------------------------
>
>                 Key: TAJO-979
>                 URL: https://issues.apache.org/jira/browse/TAJO-979
>             Project: Tajo
>          Issue Type: Bug
>            Reporter: Hyoungjun Kim
>            Priority: Critical
>
> See the title. Currently Tajo returns "Infinity".
> This is a result of Tajo.
> {noformat}
> default> select 10.0/0;
> ?divide
> -------------------------------
> Infinity
> (1 rows, 0.003 sec, 0 B selected)
> default> select 10/0;
> ERROR: / by zero
> {noformat}
> This is a result of Postgresql. 
> {noformat}
> babokim=# select 10.0/0.0;
> ERROR:  division by zero
> babokim=# select 10.0/0;
> ERROR:  division by zero
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)