Created on 06-06-2017 08:25 AM - edited 09-16-2022 04:42 AM
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 * ???
Created 06-06-2017 08:38 AM
Have you tried Invalidate metadata?
https://www.cloudera.com/documentation/enterprise/5-8-x/topics/impala_invalidate_metadata.html
Created on 06-06-2017 08:42 AM - edited 06-06-2017 08:44 AM
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
Created 06-06-2017 08:44 AM
Pls refer this link, it may help you
Created 06-06-2017 08:46 AM
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");
Created 06-06-2017 08:43 AM
[localhost:21000] > invalidate metadata hbase_capacite;
Query: invalidate metadata hbase_capacite
Fetched 0 row(s) in 0.08s