Support Questions

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

How to create phoenix view on existing HBase table by splitting primary key to composite keys

New Contributor

Considering a scenario where rowkey is combination of parts delimited by " | ".

Row Key : part1|part2|part3|1000 column family:f column: "c1" value: "1"

Row Key : part1|part2|part3|1001 column family:f column: "c2" value: "2"

How to create view in phoenix that looks like.

and insert values into Hbase through phoenix


New Contributor

according to this post:

you can do it like this, say that the existing HBase table is "t1" : 

CREATE VIEW "t1"("col1" varchar not null,
    "col2" varchar not null,
    "col3" varchar not null,
    "col4" integer not null,
    "f"."c1" integer, 
    "f"."c2" integer, 
    CONSTRAINT "ROW" PRIMARY KEY("col1", "col2", "col3", "col4")


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