phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arvind S <arvind18...@gmail.com>
Subject Re: How to map sparse hbase table with dynamic columns into Phoenix
Date Mon, 12 Dec 2016 06:49:01 GMT
Note: as your columns are all in small remember to qualify the table name,
column family and column names in double quotes "".
Below example i created should help with the rest ..  i have used capital
letters for table names and cols to make it easy ;)
=========================================================

*in hbase *...

create 'TESTER', {NAME=>'F1'}, {NAME=>'F2'}
put 'TESTER', '1','F1:C1', 'duku'
put 'TESTER', '1','F1:C2', 'count duku'
put 'TESTER', '1','F2:COL1', 'yoda'
put 'TESTER', '1','F2:COL2', 'master yoda'

*in Phoneix* ...
CREATE TABLE IF NOT EXISTS TESTER (
      ROW varchar PRIMARY KEY,
      F1.C1 varchar,
      F1.C2 varchar,
      F2.COL1 varchar,
      F2.COL2 varchar
      );
[image: Inline images 2]


now to make dynamic column view
*in hbase *... add new columns

put 'TESTER', '1','F1:C3', 'skywalker'
put 'TESTER', '1','F2:COL3', 'luke skywalker'

[image: Inline images 3]

*in Phoneix* ... make the dynamic view

CREATE VIEW TESTER_VIEW(
      F1.C3 varchar,
      F2.COL3 varchar) AS
SELECT * FROM TESTER;


[image: Inline images 4]


On 2016-12-10 05:28 ( 0530), "Sethuramaswamy, Suresh CWR" <
s...@credit-suisse.com> wrote:
> All,>
>
> We have a sparse hbase table with 3 column families and variable  column
qualifiers in each row. Can someone help me how to create a phoenix view to
map this hbase table into phoenix ?>
>
> Sample of Hbase table :>
>
> Row1:   Key         cf1.name             cf1.id     cf2.age cf3.salary>
> Row2:   Key         cf1.id     cf1.dept               cf3.salary>
> Row3:   Key         cf1.client_name               cf1.client_address
      cf3. Start_date>
>
>
>
>
> Suresh Sethuramaswamy>
> CREDIT SUISSE>
> Information Technology | Client Intelligence, KFLI 5>
> One Madison Avenue | 10010 New York | Americas>
> Phone  1 212 325 1060>
> suresh.sethuramaswamy@credit-suisse.com<ma...@credit-suisse.com> |
www.credit-suisse.com<http://www.credit-suisse.com>>
>
>
===============================================================================
>
> Please access the attached hyperlink for an important electronic
communications disclaimer: >
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html >
>
===============================================================================
>
>

Mime
View raw message