phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Rodriguez <df.rodriguez...@gmail.com>
Subject Basic mapping to HBase table
Date Fri, 04 Apr 2014 00:47:40 GMT
Hi all,

I spent a couple of hours today trying phoenix for the first time, looks
amazing.

My final objective is to do SQL on a big hbase table that has a composite
key, i decided to start slow and I was able to create a table on phoenix,
upsert values and see them on hbase, but I am not able to do the oposite:
map (using a view) values on an existing hbase to a phoenix table, i am
always getting "null" values.

Here is a basic example copied from the docs:

HBASE:
> create 't1', {NAME => 'f1', VERSIONS => 5}

PHOENIX:
> CREATE VIEW "t1" ( pk VARCHAR PRIMARY KEY, "f1".val VARCHAR );
> select * from "t1";
+------------+------------+
|     PK     |    VAL     |
+------------+------------+
+------------+------------+

Works fine since there is no data.

I add data to hbase:
> put 't1,'r1','f1','a'
> scan 't1'
ROW                                           COLUMN+CELL
 r1                                           column=f1:,
timestamp=1396558806334, value=a

But if i try to select from phoenix i get only null values.:
> select * from "t1";
+------------+------------+
|     PK     |    VAL     |
+------------+------------+
| r1         | null       |
+------------+------------+

I also tried to save it on an specific column in the column family:

> scan 't1'
ROW                                           COLUMN+CELL
 r1                                           column=f1:,
timestamp=1396558806334, value=a
 r1                                           column=f1:val,
timestamp=1396558762590, value=a

I also tried to change from varchar to integer and insert numbers but i got
the same result in both cases.

I am using phoenix 2.2.0 on EMR.

Any help you can give me is appreciated.

Thanks,
Daniel

Mime
View raw message