phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Kamil <alex.ka...@gmail.com>
Subject Re: phoenix faild to read data saved by hive
Date Fri, 05 Sep 2014 04:23:39 GMT
Ahmed, Is there a good reason why you're trying to combine hive with
phoenix?
I don't think they are compatible, phoenix manages metadata in hbase using
a special systems table which it creates behind the scenes when you
establish the connection for the first time. In general you can do all your
CRUD operations (create, read, update, delete) with phoenix alone and it
would be much faster <http://phoenix.apache.org/performance.html> than hive.


On Thu, Sep 4, 2014 at 6:54 AM, Ahmed Ashmawy <ahmed.m.ashmawy@gmail.com>
wrote:

> we building solution for social media analytics and we need a way to query
> over hbase . and found phoenix is a great tool to do that but its not
> working in our solution, here is a scenario
>
> i created table using phoenix as below
>      stmt.executeUpdate("create table test2 (mykey integer not null primary
> key, mycolumn integer)");
>
>        stmt.executeUpdate("upsert into test2 values (1,12312)");
>
>       stmt.executeUpdate("upsert into test2 values (2,45645)");
>
>
> then i created external table in hive to map hbase table as below
>
> CREATE external TABLE TEST2(
> mykey INT,  mycolumn INT )
> STORED BY 'org.apache.hadoop.hive.hbase.
> HBaseStorageHandler'
> WITH SERDEPROPERTIES ('hbase.columns.mapping' = ':key,0:mycolumn')
> TBLPROPERTIES ('hbase.table.name' = 'TEST2');
>
>
> the problem is hive not able load data inserted by phoenix!!
> so i tried to insert data using hive to see if phoenix will be able to load
> it, here is the code:
> INSERT OVERWRITE TABLE TEST2
> SELECT search_date, 22
> FROM tweets ;
>
> im surprised to sea that hive only can show result that executed by above
> query!!
>
> and for phoenix i used code below to see if it able to read data or not
>
> PreparedStatement statement = con.prepareStatement("select * from test2");
>         rset = statement.executeQuery();
>         while (rset.next()) {
>             System.out.println(rset.getString("mycolumn"));
>         }
>         statement.close();
>         con.close();
>
> phoenix also fail to see all data, result as below
> null
> null
> null
> null
> null
> null
> 12312
> 45645
>
> do you have any idea why phoenix read only data inserted by phoenix
> connection!!?
>
>
> --
> Ahmed Ashmawy
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message