Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to create View in Phoenix to connect to existing tables in Hbase?

avatar
Contributor

In my previous tables in Hbase, each column family has many qualifier: values pairs. When I try to create a view in Phoenix, no values shown in these columns. How to create a view to map all schema in my exsiting tables?

1 ACCEPTED SOLUTION

avatar
Guru

You have to explicitly list of column names in the CREATE TABLE statement, or you can use dynamic columns at the query time to specify the list of columns for this query.

View solution in original post

3 REPLIES 3

avatar
Guru

You have to explicitly list of column names in the CREATE TABLE statement, or you can use dynamic columns at the query time to specify the list of columns for this query.

avatar

As Enis said and for details you can look on below page:-

https://phoenix.apache.org/faq.html

avatar
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.