Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.2.1
-
None
-
None
-
HDP 2.6.4, Centos7
Description
Decimal Data Selected from ORC table and inserted to Hive Target table Cast Operator not working for the Decimal data Type. When data selected from ORC table and Specifically cast written to cast to value but data in the target table not getting casted to precision and scale mentioned with the CAST operator.
create table tbl_src_txt(col1 decimal(10,7)) stored as textfile;
create table tbl_src_orc(col1 decimal(10,7)) stored as orc;
create table tbl_TGT_TXT(col1 decimal(10,7)) stored as orc;
insert into tbl_src_txt select -145.299999 from (select 1)tbl;
insert into tbl_src_orc select -149.299999 from (select 1)tbl;
Data in Source Tables:
hive> select * from tbl_src_txt;
OK
-145.299999
Time taken: 0.056 seconds, Fetched: 1 row(s)
hive> select * from tbl_src_orc;
OK
-149.299999
Time taken: 0.11 seconds, Fetched: 1 row(s)
hive>
Insert into Target table from both Source table:
insert into tbl_TGT_TXT select cast(col1 as decimal(4,1)) from tbl_src_txt;
insert into tbl_TGT_TXT select cast(col1 as decimal(4,1)) from tbl_src_orc;
hive> select * from tbl_TGT_TXT;
OK
-145.3
-149.299999
Time taken: 0.065 seconds, Fetched: 2 row(s)
hive>