You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Takahiko Saito (JIRA)" <ji...@apache.org> on 2016/06/02 17:40:59 UTC

[jira] [Created] (HIVE-13928) Hive2: float value need to be single quoted inside where clause to return rows when it doesn't have to be

Takahiko Saito created HIVE-13928:
-------------------------------------

             Summary: Hive2: float value need to be single quoted inside where clause to return rows when it doesn't have to be
                 Key: HIVE-13928
                 URL: https://issues.apache.org/jira/browse/HIVE-13928
             Project: Hive
          Issue Type: Bug
    Affects Versions: 2.1.0
            Reporter: Takahiko Saito


The below select where with float value does not return any row:
{noformat}
0: jdbc:hive2://os-r7-mvjkcu-hiveserver2-11-4> drop table test;
No rows affected (0.212 seconds)
0: jdbc:hive2://os-r7-mvjkcu-hiveserver2-11-4> create table test (f float);
No rows affected (1.131 seconds)
0: jdbc:hive2://os-r7-mvjkcu-hiveserver2-11-4> insert into table test values (-35664.76),(29497.34);
No rows affected (2.482 seconds)
0: jdbc:hive2://os-r7-mvjkcu-hiveserver2-11-4> select * from test;
+------------+--+
|   test.f   |
+------------+--+
| -35664.76  |
| 29497.34   |
+------------+--+
2 rows selected (0.142 seconds)
0: jdbc:hive2://os-r7-mvjkcu-hiveserver2-11-4> select * from test where f = -35664.76;
+---------+--+
| test.f  |
+---------+--+
+---------+--+
{noformat}

The workaround is to single quote float value:
{noformat}
0: jdbc:hive2://os-r7-mvjkcu-hiveserver2-11-4> select * from test where f = '-35664.76';
+------------+--+
|   test.f   |
+------------+--+
| -35664.76  |
+------------+--+
1 row selected (0.163 seconds)
{noformat}



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