Hive external HBase table
CREATE [EXTERNAL] TABLE [if not exists] table_name
[(Col_name data_type [COMMENT col_comment],...)]
[COMMENT table_comment]
[Partitioned by (col_name data_type
[COMMENT col_comment],...)]
[Clustered by (col_name, col_name ,...)
[Sorted by (col_name [ASC | DESC],...)]
INTO num_buckets BUCKETS]
[Row format row_format]
[Stored as file_format]
[LOCATION hdfs_path]
Connect an existing table in HBase
Create external table table_name (id int, value string)
Stored by 'org. apache. Hadoop. hive. hbase. hbasestoragehandler'
With serdeproperties ("hbase. columns. mapping" = ": key, cf1: val ")
TBLPROPERTIES ("hbase. table. name" = "xyz ");
The red area is modified according to the actual situation. The green area corresponds to the HBase table. cf1 indicates the column cluster name, val indicates the column name, and key indicates that the row of HBase is given to the first field, the id marked in red in the preceding example.