Hive external HBase table

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.