Unable to see columns in Phoenix View

2019-05-26 13:09发布

I have a tweet table in HBase,Please find below it's description using hbase describe tweet

{NAME => 'tweets', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICAT
ION_SCOPE => '0', COMPRESSION => 'GZ', VERSIONS => '1', TTL => 'FOREVER', MIN_VE
RSIONS => '0', KEEP_DELETED_CELLS => 'FALSE', BLOCKSIZE => '65536', IN_MEMORY =>
 'false', BLOCKCACHE => 'true'}

and created it's corresponding view in Phoenix as

 CREATE VIEW "tweets" ( pk VARCHAR PRIMARY KEY,"tweets".fromuser VARCHAR );

But when i do Select * from "tweets" ,I can see only primary keys,fromuser column data is empty ,same thing happens when i do

select fromuser from "tweets"

标签: hbase phoenix
2条回答
唯我独甜
2楼-- · 2019-05-26 13:53

When creating your views you have to double quote the column family name as well as the column's name:

CREATE VIEW "tweets" ( pk VARCHAR PRIMARY KEY,"tweets"."fromuser" VARCHAR );

So in your example above you need to put double quotes around "fromuser".

查看更多
【Aperson】
3楼-- · 2019-05-26 13:53

How looks your tweets HBase table?

If you create view using Phoenix on existing HBase table in source table should exist given column family and qualifier. So in table tweets you should have family "tweets" and "fromuser" column qualifier.

https://phoenix.apache.org/faq.html#How_I_map_Phoenix_table_to_an_existing_HBase_table

查看更多
登录 后发表回答