hbase - External table when queried from HIVE returns NULL for decimal datatypes -
i sqooped mysql
table hbase
, try create external table in hive.
i have column of decimal (38,1) in mysql
moved hbase
.
now while creating external table hive
, while fetching records getting null values. remaining values arr string data type hive external table holds values.
while creating external table in hive
data type used decimal(38,1)
.
any other solutions getting actual values in hive external table?
create table:
create external table namespace.tablename(c1 string,c2_col string,c3_col decimal(38,1),c4_col string) stored 'org.apache.hadoop.hive.hbase.hbasestoragehandler' serdeproperties ("hbase.columns.mapping" = ":key,cf1:a,cf1:b,cf1:c")tblproperties("hbase.table.name" = "namespace.hbasetablename");
remaining values fetched 1 column decimal (38,1)
mysql
moved hbase
. hbase
hive
there mismatch column
sqoop serializes values hbase converting each field string representation (as if importing hdfs in text mode), , inserts utf-8
bytes of string in target cell.
since hbase holds data string format query trying find decimal, therefore getting null result. suggests create hive table string datatype , cast in decimal format during query.
example:
select cast('string_col' decimal(38,1)) string_col table;
Comments
Post a Comment