Practical operation and problem summary of Hive/hbase/hadoop/mysql in CentOS

Source: Internet
Author: User

Hive Chinese garbled problem

As we all know, we are using the MySQL storage hive metadata, you can execute with Chinese comments in the table file, to solve the problem of Chinese garbled:

To set the metabase to Latin1 and set the encoding of the data table stored in Chinese to the utf-8 format, that is, the table stored in hive is utf-8.

Some of the following are not feasible:

1. Set the meta database (MySQL) encoding to utf-8.hive run error

2. Set the meta server (MySQL) encoding to latin1. The table will appear when you import incorrect string value: ' \xc2\x8a\xc2\xa8\xc3\xa7 ... ' The error.

Therefore, the database is encoded as latin1 and the table encoding is set to UTF8

Example:

1. Build hive's meta database according to LATIN1 encoding

2. Modify the Hive-seite.xml connection code to UTF8

3. Modify the table encoding

Simple: Values for column ALTER TABLE DETAIL3 modify values  character set UTF8; add Comment: Name is column ALTER TABLE tabletest modify name COMMENT VA Rchar (character) set UTF8;

If the hive client is running in SecureCRT, the

(1) The Options-session options-character encoding of SECURECRT is set to UTF-8;
(2) securecrt options-session options-normal font is set to Fixedsys and the character set to chinese_gb2312.

Practical operation and problem summary of Hive/hbase/hadoop/mysql in CentOS

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.