2

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"
Amit_Hora
  • 716
  • 1
  • 8
  • 27

2 Answers2

2

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

slm
  • 15,396
  • 12
  • 109
  • 124
0

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

IgorekPotworek
  • 1,317
  • 13
  • 33
  • yes i do have that ,below is the sample of scan ROW COLUMN+CELL 1445246112_656035936 column=tweets:fromuser, timestamp=1445259952715, value=Vee 334168064 rArjey – Amit_Hora Oct 21 '15 at 07:26
  • Strange. Try to add double quotes to qualifier : CREATE VIEW "tweets" ( pk VARCHAR PRIMARY KEY,"tweets"."fromuser" VARCHAR ); and select "tweets"."fromuser" from "tweets". – IgorekPotworek Oct 21 '15 at 08:18
  • It wirked Thanks :) but can you explain why i have to give it in quotes? – Amit_Hora Oct 28 '15 at 07:24
  • Unfortunately no:). Answer comes only from my empirical experience:). – IgorekPotworek Oct 28 '15 at 10:26