hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ganesh Tripathi (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HIVE-16514) Decimal datatype is truncating 1st digit of the number while storing into Parquet file
Date Wed, 20 Sep 2017 14:03:00 GMT

    [ https://issues.apache.org/jira/browse/HIVE-16514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16173215#comment-16173215
] 

Ganesh Tripathi edited comment on HIVE-16514 at 9/20/17 2:02 PM:
-----------------------------------------------------------------

This is working for me , Can you please elaborate your issue, or how to replicate this.
I have done following, and is working for me perfectly: 
*  Created a loader table .
{code:java}
create table HIVE_16514_l (col1 decimal(38,20));
{code}

* Inserted a record into it.
 {code:java}
insert into table HIVE_16514_l values (9389587.19800467);
{code}

* Created a Parquet table with decimal column. 
 {code:java}
CREATE EXTERNAL TABLE HIVE_16514_PARQ (c2 Decimal (38,20))  STORED AS PARQUET LOCATION 'HIVE_16514_PARQ
';
 {code}

* Insert overwrite parquet table with data inserted in loader.
 {code:java}
insert overwrite table HIVE_16514_PARQ select * from HIVE_16514_l;
 {code}

* Retrieved results from parquet table , amd which appears to be correct.
 {code:java}
hive> select * from HIVE_16514_PARQ ;
OK
9389587.19800467
Time taken: 0.146 seconds, Fetched: 1 row(s)
 {code}




was (Author: gatripat):
This is working for me , Can you please elaborate your issue, or how to replicate this.
I have done following, and is working for me perfectly: 
# Created a loader table .
{code:java}
create table HIVE_16514_l (col1 decimal(38,20));
{code}

# Inserted a record into it.
 {code:java}
insert into table HIVE_16514_l values (9389587.19800467);
{code}

# Created a Parquet table with decimal column. 
 {code:java}
CREATE EXTERNAL TABLE HIVE_16514_PARQ (c2 Decimal (38,20))  STORED AS PARQUET LOCATION 'HIVE_16514_PARQ
';
 {code}

# Insert overwrite parquet table with data inserted in loader.
 {code:java}
insert overwrite table HIVE_16514_PARQ select * from HIVE_16514_l;
 {code}

# Retrieved results from parquet table , amd which appears to be correct.
 {code:java}
hive> select * from HIVE_16514_PARQ ;
OK
9389587.19800467
Time taken: 0.146 seconds, Fetched: 1 row(s)
 {code}



> Decimal datatype is truncating 1st digit of the number while storing into Parquet file
> --------------------------------------------------------------------------------------
>
>                 Key: HIVE-16514
>                 URL: https://issues.apache.org/jira/browse/HIVE-16514
>             Project: Hive
>          Issue Type: Bug
>          Components: File Formats, Hive
>    Affects Versions: 1.1.0
>         Environment: CDH 5.7
>            Reporter: Surendranatha Reddy
>            Priority: Blocker
>
> We declared one of the Hive Parquet table column as Decimal (38,20) .
> We have inserted data from one of the intermediate table using sum function with "insert
into select " statement. 
> Sum value is 9389587.19800467 . 
> Where as it is getting stored as 389587.19800467
>  First digit of number is getting truncated  while it getting stored in Table. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message