Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to create phoenix table using existing hbase table ??

Solved Go to solution
Highlighted

How to create phoenix table using existing hbase table ??

Super Collaborator

my use case i need to create phoenix table by using existing hbase table. I have got only one way to map hbase table i,e creating view table. is there any other way to create phoenix table by using existing hbase table ??

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: How to create phoenix table using existing hbase table ??

Guru

Lets say you have an existing HBase table called "transactions", column family called "transactions" that has a column called transactionId. You can map that table to a Phoenix view with: CREATE VIEW "TransactionHistory" (k VARCHAR primary key, "Transactions"."transactionId" VARCHAR);. Now you should be able to Select "transactionId" from "Transactions". You can use ALTER VIEW to add additional columns from he HBASE table after that.

View solution in original post

3 REPLIES 3
Highlighted

Re: How to create phoenix table using existing hbase table ??

Highlighted

Re: How to create phoenix table using existing hbase table ??

Guru

Lets say you have an existing HBase table called "transactions", column family called "transactions" that has a column called transactionId. You can map that table to a Phoenix view with: CREATE VIEW "TransactionHistory" (k VARCHAR primary key, "Transactions"."transactionId" VARCHAR);. Now you should be able to Select "transactionId" from "Transactions". You can use ALTER VIEW to add additional columns from he HBASE table after that.

View solution in original post

Highlighted

Re: How to create phoenix table using existing hbase table ??

New Contributor

CREATE TABLE table2 LIKE table1;

INSERT INTO table2 SELECT * FROM table1;

These are sql queries which can be used but not working with base..

By d way nice question.

I am also trying for it.

Don't have an account?
Coming from Hortonworks? Activate your account here