Chun Chang created DRILL-1043:
---------------------------------

             Summary: decimal28 negative number compares larger than positive 
int
                 Key: DRILL-1043
                 URL: https://issues.apache.org/jira/browse/DRILL-1043
             Project: Apache Drill
          Issue Type: Bug
          Components: Functions - Drill
            Reporter: Chun Chang
            Assignee: Mehant Baid


#Wed Jun 18 10:27:23 PDT 2014
git.commit.id.abbrev=894037a

The negative decimal28 number such as -999999999.000000000 and 
-999999999999999999.000000000 is compared larger than positive int value:

postgres:
foodmart=# select c_row, c_int, cast(c_decimal28 as decimal(28,9)) from data 
where c_row < 12 and c_int >= cast(c_decimal28 as decimal(28,9));
 c_row |  c_int   |          c_decimal28
-------+----------+-------------------------------
     1 |        0 |                   0.000000000
     2 |        1 |                   1.000000000
     5 |      123 |          -999999999.000000000
     6 | 92032039 |                   0.000000010
    11 |    32767 | -999999999999999999.000000000
(5 rows)

drill:
0: jdbc:drill:schema=dfs> select c_row, c_int, cast(c_decimal28 as 
decimal(28,9)) from data where c_row < 12 and c_int >= cast(c_decimal28 as 
decimal(28,9));
+------------+------------+------------+
|   c_row    |   c_int    |   EXPR$2   |
+------------+------------+------------+
| 1          | 0          | 0E-9       |
| 2          | 1          | 1.000000000 |
| 6          | 92032039   | 1.0E-8     |
+------------+------------+------------+
3 rows selected (0.249 seconds)

notice two rows are missing from drill output due to the comparison error.



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

Reply via email to