Unable to see columns in Phoenix View

回眸只為那壹抹淺笑 提交于 2020-01-13 19:09:37

问题


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"

回答1:


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".




回答2:


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



来源:https://stackoverflow.com/questions/33235550/unable-to-see-columns-in-phoenix-view

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!