You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by Siva <sb...@gmail.com> on 2015/02/10 21:46:45 UTC

Mapping HBase table in Phoenix

Hi Everyone,



When I map a table in Phoenix from Hbase which has two column families, I
could not able to see the data for 2nd column family from Phoenix.



Hbase:



create 'tab_2_cf', 'cf1', 'cf2'



put 'tab_2_cf', 'r1', 'cf1:name', 'asdf'



put 'tab_2_cf', 'r1', 'cf1:address', 'CALIF'



>From Phoenix:



create view "tab_2_cf"(pk varchar primary key, "cf1"."name" varchar,
"cf2"."address" varchar);



queried the table from phoenix, data is being shown as NULL for Column
address.



0: jdbc:phoenix:172.31.45.176:2181:/hbase> select * from "tab_2_cf";

+------------+------------+------------+

|     PK     |    name    |  *address*   |

+------------+------------+------------+

| r1         | asdf       | null       |

+------------+------------+------------+



Any help on this?



Thanks,

Siva.

Re: Mapping HBase table in Phoenix

Posted by Anoop John <an...@gmail.com>.
put 'tab_2_cf', 'r1', 'cf1:address', 'CALIF'

put to cf2 or cf1??   Typo?

-Anoop-

On Wed, Feb 11, 2015 at 2:16 AM, Siva <sb...@gmail.com> wrote:

> Hi Everyone,
>
>
>
> When I map a table in Phoenix from Hbase which has two column families, I
> could not able to see the data for 2nd column family from Phoenix.
>
>
>
> Hbase:
>
>
>
> create 'tab_2_cf', 'cf1', 'cf2'
>
>
>
> put 'tab_2_cf', 'r1', 'cf1:name', 'asdf'
>
>
>
> put 'tab_2_cf', 'r1', 'cf1:address', 'CALIF'
>
>
>
> From Phoenix:
>
>
>
> create view "tab_2_cf"(pk varchar primary key, "cf1"."name" varchar,
> "cf2"."address" varchar);
>
>
>
> queried the table from phoenix, data is being shown as NULL for Column
> address.
>
>
>
> 0: jdbc:phoenix:172.31.45.176:2181:/hbase> select * from "tab_2_cf";
>
> +------------+------------+------------+
>
> |     PK     |    name    |  *address*   |
>
> +------------+------------+------------+
>
> | r1         | asdf       | null       |
>
> +------------+------------+------------+
>
>
>
> Any help on this?
>
>
>
> Thanks,
>
> Siva.
>

回复:Mapping HBase table in Phoenix

Posted by xuxc1120 <xu...@vip.qq.com>.
just as  you said,it has 2 families in your table:'cf1'and 'cf2', ‍
but you mapped "cf2"."address"  into the ‍view and you put "‍address" in 'cf1' family,so you will get a NULL in the view.‍
xuxc.




------------------ 原始邮件 ------------------
发件人: "Siva";<sb...@gmail.com>;
发送时间: 2015年2月11日(星期三) 凌晨4:46
收件人: "user"<us...@phoenix.apache.org>; "dev"<de...@phoenix.apache.org>; 

主题: Mapping HBase table in Phoenix




Hi Everyone,
 
 
 
When I map a table in Phoenix from Hbase which has two column families, I could not able to see the data for 2nd column family from Phoenix.
 
 
 
Hbase:
 
 
 
create 'tab_2_cf', 'cf1', 'cf2'
 
 
 
put 'tab_2_cf', 'r1', 'cf1:name', 'asdf'
 
 
 
put 'tab_2_cf', 'r1', 'cf1:address', 'CALIF'
 
 
 
From Phoenix:
 
 
 
create view "tab_2_cf"(pk varchar primary key, "cf1"."name" varchar, "cf2"."address" varchar);
 
 
 
queried the table from phoenix, data is being shown as NULL for Column address.
 
 
 
0: jdbc:phoenix:172.31.45.176:2181:/hbase> select * from "tab_2_cf";
 
+------------+------------+------------+
 
|     PK     |    name    |  address   |
 
+------------+------------+------------+
 
| r1         | asdf       | null       |
 
+------------+------------+------------+
 
 
 
Any help on this?
 
 
 
Thanks,
 
Siva.