Reply
New Contributor
Posts: 6
Registered: ‎06-06-2017

impala hbase hive

Hello

 

i have created a hbase table, populating it with pig.

To use impala, i create an external table in hive pointing on hbase but when i use impala, i can only see the row_id but not entire row of the table :

 

[localhost:21000] > describe hbase_capacite;
Query: describe hbase_capacite
+---------+--------+---------+
| name    | type   | comment |
+---------+--------+---------+
| row_dy  | string |         |
| calcap  | double |         |
| depcap  | int    |         |
| yearcap | int    |         |
+---------+--------+---------+
Fetched 4 row(s) in 0.01s
[localhost:21000] > select count(*) from hbase_capacite;
Query: select count(*) from hbase_capacite
+----------+
| count(*) |
+----------+
| 22       |
+----------+
Fetched 1 row(s) in 0.57s
[localhost:21000] > select * from hbase_capacite;
Query: select * from hbase_capacite

Fetched 0 row(s) in 0.16s
[localhost:21000] > select row_dy from hbase_capacite;
Query: select row_dy from hbase_capacite
+--------+
| row_dy |
+--------+
| 12005  |
| 12006  |
| 12007  |
| 12008  |
| 12009  |
| 12010  |
| 12011  |
| 12012  |
| 12013  |
| 12014  |
| 12015  |
| 942005 |
| 942006 |
| 942007 |
| 942008 |
| 942009 |
| 942010 |
| 942011 |
| 942012 |
| 942013 |
| 942014 |
| 942015 |
+--------+
Fetched 22 row(s) in 0.16s
[localhost:21000] > select row_dy from hbase_capacite where row_dy='12005';
Query: select row_dy from hbase_capacite where row_dy='12005'
+--------+
| row_dy |
+--------+
| 12005  |
+--------+
Fetched 1 row(s) in 0.12s

 

[localhost:21000] > select * from hbase_capacite;
Query: select * from hbase_capacite

Fetched 0 row(s) in 0.18s
[localhost:21000] >

 

 

why i cant see all the fields of my table when i do a select * ???

 

 

Posts: 519
Topics: 14
Kudos: 92
Solutions: 45
Registered: ‎09-02-2016

Re: impala hbase hive

New Contributor
Posts: 6
Registered: ‎06-06-2017

Re: impala hbase hive

[ Edited ]

hello

 

 

yes, i made that in impala

 

[localhost:21000] > invalidate metadata hbase_capacite;
Query: invalidate metadata hbase_capacite

Fetched 0 row(s) in 0.08s

New Contributor
Posts: 6
Registered: ‎06-06-2017

Re: impala hbase hive

[localhost:21000] > invalidate metadata hbase_capacite;
Query: invalidate metadata hbase_capacite

Fetched 0 row(s) in 0.08s

Posts: 519
Topics: 14
Kudos: 92
Solutions: 45
Registered: ‎09-02-2016

Re: impala hbase hive

Highlighted
New Contributor
Posts: 6
Registered: ‎06-06-2017

Re: impala hbase hive

i ve created a hive table like that :

 

DROP TABLE IF EXISTS hbase_capacite;
   
CREATE EXTERNAL TABLE IF NOT EXISTS hbase_capacite (row_dy  string, yearcap int, depcap int, calcap double)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" =    ":key,capacite_data:yearcap,capacite_data:depcap,capacite_data:calcap")
TBLPROPERTIES("hbase.table.name" = "capacite");