运行的建表语句
create table my_report(myrow string,lastname string) stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' with serdeproperties("hbase.columns.mapping"=":key,cf1:firstname") tblproperties("hbase.table.name"="my_table");
报错FAILED: Error in metadata: MetaException(message:Table my_table already exists within HBase; use CREATE EXTERNAL TABLE instead to register it in Hive.) 提示这是一张外部表,需要使用 external命令创建
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
正确方法
create external table my_report(myrow string,lastname string) stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' with serdeproperties("hbase.columns.mapping"=":key,cf1:firstname") tblproperties("hbase.table.name"="my_table");