Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on 05-24-2016 01:26 PM - edited 09-16-2022 03:21 AM
Hbase has a nice feature called counter increment, where you can atomicly increment a value and get back the result. I want to create ta simple external table over this hbase table, but I dont know how to choose the correct data type for Hive/Impala.
The value of colfam:FL_Lock is this:
20160512_000006 column=colfam:FL_Lock, timestamp=1464120550634, value=\x00\x00\x00\x00\x00\x00\x00\x00
If I create external table with string, the query returns nothing, no error
If I create external table with bigint/decimal/int, the query returns NULL and ERROR from Impala:
Error converting column colfam:FL_Lock: '' TO INT
Any ideas how to map correctly this Hbase column?
Thanks
Tomas
Created 06-10-2016 05:44 AM
Actually this has been already resolved, we changed the create table statetment, added #b (hash b - as binary).
create external table md_extract_file_status ( table_key string, fl_counter bigint )
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ('hbase.columns.mapping' = ':key,colfam:FL_Counter#b ) TBLPROPERTIES('hbase.table.name' ='HBTABLE');
Created 06-10-2016 02:19 AM
Created 06-10-2016 05:44 AM
Actually this has been already resolved, we changed the create table statetment, added #b (hash b - as binary).
create external table md_extract_file_status ( table_key string, fl_counter bigint )
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ('hbase.columns.mapping' = ':key,colfam:FL_Counter#b ) TBLPROPERTIES('hbase.table.name' ='HBTABLE');