I notice that if I define a table in hive (which creates an underlying
hbase table),
then
hive-shell>describe table_name;
impala-shell> refresh;
describe table_name;
*the order of the columns returned is different *-
this would normally not matter, however impala expects columns to be in a
specific order
(as it does not support "insert into (field names..)" syntax
--- for example:
[[email protected] ~]$ hive shell
Logging initialized using configuration in
jar:file:/usr/lib/hive/lib/hive-common-0.10.0-cdh4.3.0.jar!/hive-log4j.properties
Hive history
file=/tmp/cloudera/hive_job_log_6143a717-edee-4184-bc67-8750c28358c7_649938235.txt
hive> CREATE TABLE allocation2(
liability_shell_id int,
product_id int,
direction string,
allocation_date timestamp
)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" =
":key,cf1:product_id,cf1:direction,cf1:allocation_date")
TBLPROPERTIES ("hbase.table.name" = "hbase_allocation2");
OKproduct_id int,
direction string,
allocation_date timestamp
)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" =
":key,cf1:product_id,cf1:direction,cf1:allocation_date")
TBLPROPERTIES ("hbase.table.name" = "hbase_allocation2");
Time taken: 4.005 seconds
hive> describe allocation2;
OK
liability_shell_id int from deserializer
product_id int from deserializer
direction string from deserializer
allocation_date timestamp from deserializer
Time taken: 0.407 seconds
[localhost.localdomain:21000] > describe allocation2;
Query: describe allocation2
Query finished, fetching results ...
+--------------------+-----------+---------+
name | type | comment |
+--------------------+-----------+---------+
liability_shell_id | int | |
allocation_date | timestamp | |
direction | string | |
product_id | int | |
+--------------------+-----------+---------++--------------------+-----------+---------+
liability_shell_id | int | |
allocation_date | timestamp | |
direction | string | |
product_id | int | |
Returned 4 row(s) in 0.34s