Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

How to synchronize data to Phoenix and HBase in Hive ?

New Contributor

Hi:

I want Hive to synchronize data to Phoenix and HBase

now :

create table test1(key string ,name string comment 'name value',addr string comment 'addr value')

STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'

WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,info:name,info:addr")

TBLPROPERTIES("hbase.table.name" = "test1");

how to do :

create table test1(key string ,name string comment 'name value',addr string comment 'addr value')

STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler','org.apache.phoenix.hive.PhoenixStorageHandler'

WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,info:name,info:addr")

TBLPROPERTIES

(

"hbase.table.name" = "test1"

"phoenix.table.name" = "test1",

);

Sorry, I'm not good at English.

Thanks.

1 REPLY 1

Explorer

I'm not sure what you wanted to express by listing two storage handlers; but for a Phoenix storage handler example, look at this: https://phoenix.apache.org/hive_storage_handler.html

Note that it needs different serdeproperties than HBase does.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.