Support Questions
Find answers, ask questions, and share your expertise

How to create Phoenix View on existing HBase table with dynamic/rolling Column Family Name

New Contributor

Hi Everybody,

i've got an existing hbase table with a rowkey consists of two numbers and a columnfamily (called d) .Within this column family there are several Columns which are a dates as running number followed by a character e.g. 20160808[c|s|m]. So how can i map the cf via a Create view-Statement or something else to read the data? I need something like a wildcard-mapping for the column family.

Thanks in advance.

2 REPLIES 2

can you explain your use-case with some data. Try to formulate in form of any DDL and SELECTs you are looking for?

New Contributor

Hi,

i've got an hbase table created like this : create 'hbase_table',{NAME => 'd', BLOOMFILTER => 'NONE', VERSIONS = .......}. I've got only one column family. The java client which fills hbase generates a rowkey consisting of two numbers and stores several columns within the column family 'd'. The name of these columns are made of the actual date following by a character like this 20151119c. The name is stored binary. So if i run a scan in hbase shell i will get the following:

"NUMBER1NUMBER2" column=d:\x07\xE0\x07\x0Ds, timestamp=1472144870610, value=\x00\x00\x00\x00\x00\x04\xC7\xD3

Now i want to map the existing hbase table with phoenix with a view like:

create view "namespace:hbase_table" (A UNSIGNED_INT NOT NULL, B UNSIGNED_INT NOT NULL, "d".val VARCHAR(40) constraint pk_hbase_table PRIMARY_KEY(A,B); --> "val" stands for the running number with the caracter (

20151119c)

So i've heard that Phoenix have to match the correct Column-Name. So is it possible to match them like a wildcard ?