You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Ganesh Tripathi (JIRA)" <ji...@apache.org> on 2017/09/20 14:01:13 UTC

[jira] [Commented] (HIVE-16514) Decimal datatype is truncating 1st digit of the number while storing into Parquet file

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

Ganesh Tripathi commented on HIVE-16514:
----------------------------------------

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:shell}
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)