phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Taylor <jamestay...@apache.org>
Subject Re: How to map sparse hbase table with dynamic columns into Phoenix
Date Mon, 12 Dec 2016 23:30:21 GMT
Hi Suresh,
The typical way is to have a column that represents the type. Then you
create a view with a where clause that matches on the type value. There's
an example on our website here: http://phoenix.apache.org/views.html

Thanks,
James

On Mon, Dec 12, 2016 at 7:10 AM, Sethuramaswamy, Suresh CWR <
suresh.sethuramaswamy@credit-suisse.com> wrote:

> Arvind,
>
>
>
> Thanks for your time in trying to help, but my case is against each row I
> have different set of column qualifiers.My question is how to create a
> phoenix view or table mapping this hbase table that has no constant set of
> column qualifiers against each row.
>
>
>
> Suresh Sethuramaswamy
> Client Intelligence
> +1 212 325 1060 <(212)%20325-1060> (*105 1060)
>
> *From:* Arvind S [mailto:arvind18352@gmail.com]
> *Sent:* Monday, December 12, 2016 1:49 AM
> *To:* user@phoenix.apache.org
> *Subject:* Re: How to map sparse hbase table with dynamic columns into
> Phoenix
>
>
>
> 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 <(212)%20325-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 >
> > ===============================================================================
> >
> >
>
>
> ============================================================
> ==================
> 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