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