tajo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hyunsik Choi (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAJO-344) Tajo cannot recognize negative numeric expressions
Date Sun, 08 Dec 2013 07:30:37 GMT

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

Hyunsik Choi commented on TAJO-344:

Thank you for your detailed review. 

The result of Math.round may be different from other programming languages. This is because
Java adopts some different rounding manner \[1\]. So, we can get a mismatch as follows:

Math.round(-5.5) -> -5

hyunsik=> select round(-5.5);
(1 row)

MariaDB [(none)]> select round(-5.5);
| round(-5.5) |
|          -6 |
1 row in set (0.00 sec)

Especially, we could face the result mismatch problem when we use a vectorized engine based
on C++. This patch also contains the workaround code. I missed the detail comment for this
reason. Since this workaround code may make other guys confuse, I'll add some notes on Round

In my opinion, succeeded hunks are not problem because it just means somewhat difference of
diff lines but success. If we have to rebase all patches that cause even success hunk, contributors
will be exhausted due to too frequent rebase.

 \[1\] https://en.wikipedia.org/wiki/Rounding#Round_half_up

> Tajo cannot recognize negative numeric expressions
> --------------------------------------------------
>                 Key: TAJO-344
>                 URL: https://issues.apache.org/jira/browse/TAJO-344
>             Project: Tajo
>          Issue Type: Bug
>          Components: operator/function/udf, parser, planner/optimizer
>            Reporter: Hyunsik Choi
>            Assignee: Hyunsik Choi
>             Fix For: 0.8-incubating
>         Attachments: TAJO-344.patch
> The parser cannot deal with negative numeric values. You can reproduce the problem as
> {code}
> select -1;
> {code}
> We have to fix it.

This message was sent by Atlassian JIRA

View raw message