Phoenix (vii) Map hbase data table

Source: Internet
Author: User
Tags table name
1. Description

After installing Phoenix, the data tables that already exist in HBase will not be mapped automatically, so it is necessary to manually configure the existing data tables in the Phoenix to operate HBase.


2. Create an HBase table

> Create ' Phoenix ', ' info '


3. Inserting Data

> put ' Phoenix ', ' row001 ', ' Info:name ', ' Phoenix '
> put ' Phoenix ', ' row002 ', ' info:name ', ' hbase '

High-energy warning: hbase data table default primary key column name is row


4. Create a Phoenix table

Create a data table of the same structure in Phoenix

> CREATE TABLE "phoenix" (ROW varchar PRIMARY key, "info". " Name "varchar");

Early Warning high energy: it is important to note that table and column families and column names need to be enclosed in double quotation marks, because hbase is case-sensitive, and Phoenix automatically converts lowercase to uppercase when creating a table, if not surrounded by double quotes. This will create another table, Phoenix, in HBase.


5. Verification

View data in Phoenix's CLI interface.

> select * from "Phoenix";

High-energy warning: Here the query table name needs to be enclosed in double quotation marks, forcing not to be converted to uppercase.

The mapping was successful, and the "Phoenix" table in HBase could be manipulated directly from Phoenix.

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.