[
https://issues.apache.org/jira/browse/HAWQ-1054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15527330#comment-15527330
]
Oleksandr Diachenko edited comment on HAWQ-1054 at 9/27/16 8:32 PM:
--------------------------------------------------------------------
[~GodenYao] right, not very intuitive, that's why I was confused.
{code}
desc hive_orc_all_types;
OK
s1 string
s2 string
n1 int
d1 double
dc1 decimal(38,18)
tm timestamp
f float
bg bigint
b boolean
tn tinyint
sml smallint
dt date
vc1 varchar(5)
c1 char(3)
bin binary
Time taken: 0.917 seconds, Fetched: 15 row(s)
{code}
{code}
\d pxf_hive_orc_types
External table "public.pxf_hive_orc_types"
Column | Type | Modifiers
--------+-----------------------------+-----------
t1 | text |
t2 | text |
num1 | integer |
dub1 | double precision |
dec1 | numeric |
tm | timestamp without time zone |
r | real |
bg | bigint |
b | boolean |
tn | smallint |
sml | smallint |
dt | date |
vc1 | character varying(5) |
c1 | character(3) |
bin | bytea |
Type: readable
Encoding: UTF8
Format type: custom
Format options: formatter 'pxfwritable_import'
External location:
pxf://localhost:51200/hive_orc_all_types?PROFILE=HiveORC&delimiter=^A
{code}
Table definitions are correct, float column mapped to real.
was (Author: odiachenko):
[~GodenYao] right, not very intuitive, that's why I was confused.
{code}
desc hive_orc_all_types;
OK
s1 string
s2 string
n1 int
d1 double
dc1 decimal(38,18)
tm timestamp
f float
bg bigint
b boolean
tn tinyint
sml smallint
dt date
vc1 varchar(5)
c1 char(3)
bin binary
Time taken: 0.917 seconds, Fetched: 15 row(s)
{code}
{code}
\d pxf_hive_orc_types
External table "public.pxf_hive_orc_types"
Column | Type | Modifiers
--------+-----------------------------+-----------
t1 | text |
t2 | text |
num1 | integer |
dub1 | double precision |
dec1 | numeric |
tm | timestamp without time zone |
r | real |
bg | bigint |
b | boolean |
tn | smallint |
sml | smallint |
dt | date |
vc1 | character varying(5) |
c1 | character(3) |
bin | bytea |
Type: readable
Encoding: UTF8
Format type: custom
Format options: formatter 'pxfwritable_import'
External location:
pxf://localhost:51200/hive_orc_all_types?PROFILE=HiveORC&delimiter=^A
{code}
> Real/float4 rounding issues for HiveORC profile
> -----------------------------------------------
>
> Key: HAWQ-1054
> URL: https://issues.apache.org/jira/browse/HAWQ-1054
> Project: Apache HAWQ
> Issue Type: Bug
> Components: PXF
> Reporter: Oleksandr Diachenko
> Assignee: Oleksandr Diachenko
> Priority: Critical
> Fix For: 2.0.1.0-incubating
>
>
> Looks like real values are being incorrectly rounded:
> {code}
> SELECT t1, r FROM pxf_hive_orc_types WHERE r = 7.7;
> t1 | r
> ----+---
> (0 rows)
> SELECT t1, r FROM pxf_hive_orc_types WHERE r > 7.6;
> t1 | r
> ----------------------+------
> row1 | 7.7
> row2 | 8.7
> row3 | 9.7
> row4 | 10.7
> row5 | 11.7
> row6 | 12.7
> row7 | 7.7
> row8 | 7.7
> row9 | 7.7
> row10 | 7.7
> row11 | 7.7
> row12_text_null | 7.7
> row13_int_null | 7.7
> row14_double_null | 7.7
> row15_decimal_null | 7.7
> row16_timestamp_null | 7.7
> row18_bigint_null | 7.7
> row19_bool_null | 7.7
> row20_tinyint_null | 7.7
> row21_smallint_null | 7.7
> row22_date_null | 7.7
> row23_varchar_null | 7.7
> row24_char_null | 7.7
> row25_binary_null | 7.7
> (24 rows)
> {code}
> The same query works fine in Hive:
> {code}
> hive> select f from hive_orc_all_types where f = 7.7;
> OK
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> 7.7
> Time taken: 0.032 seconds, Fetched: 19 row(s)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)