You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Laveine Frederic (JIRA)" <ji...@apache.org> on 2015/01/29 13:51:34 UTC

[jira] [Created] (PHOENIX-1615) [PHOENIX] Problem using PDataType.DOUBLE

Laveine Frederic created PHOENIX-1615:
-----------------------------------------

             Summary: [PHOENIX] Problem using PDataType.DOUBLE
                 Key: PHOENIX-1615
                 URL: https://issues.apache.org/jira/browse/PHOENIX-1615
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.1
         Environment: Linux Suse11 SP3 + Hbase 0.98.7-hadoop2 + Phoenix 4.1.x
            Reporter: Laveine Frederic


We’re using HBase 0.98.7-hadoop2 with Phoenix (phoenix-4.1.0-server-hadoop2.jar) and we have some problems with  PDataType.Double

When we look with HBase Shell, the data are good (except sign which is flipped but it’s normal)
hbase(main):010:0> scan 'RESM_RESULTAT_RUBRIQUE', {STARTROW => 'DRO050/201405/02003027 ', ENDROW => 'DRO050/201405/02003027~', COLUMNS => ['F:R3957_1_01_MNT:toDouble']}
ROW                                               COLUMN+CELL
DRO050/201405/02003027//20141124102508           column=F:R3957_1_01_MNT, timestamp=1422362595520, value=-5.76

hbase(main):005:0> scan 'RESM_RESULTAT_RUBRIQUE', {STARTROW => 'DRO050/201405/02000937 ', ENDROW => 'DRO050/201405/02000937~', COLUMNS => ['F:R3957_1_01_MNT:toDouble']}
ROW                                               COLUMN+CELL
DRO050/201405/02000937//20141124102508           column=F:R3957_1_01_MNT, timestamp=1422362590187, value=-2.53


But if we use Phoenix sqlline.py, Phoenix API through Squirrel or Java Code, all the values are not well restituted (Ex : 2.5300000000000002 instead of 2.53)
0: jdbc:phoenix:lx1675> select PAC, MOIS_DE_PAIE, MATRICULE, DATE_TRAITEMENT, R3957_1_01_MNT from RESM_RESULTAT_RUBRIQUE (R3957_1_01_MNT Double)
. . . . . . . . . . . > where PAC='DRO050' and MOIS_DE_PAIE='201405' and MATRICULE in ('02000937','02003027');
+------------+--------------+------------+---------------------+----------------+
|    PAC     | MOIS_DE_PAIE | MATRICULE  |   DATE_TRAITEMENT   | R3957_1_01_MNT |
+------------+--------------+------------+---------------------+----------------+
| DRO050     | 201405       | 02000937   | 2014-11-24          | 2.5300000000000002 |
| DRO050     | 201405       | 02003027   | 2014-11-24          | 5.76           |
+------------+--------------+------------+---------------------+----------------+
2 rows selected (0.219 seconds)

Thanks for your help




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