Utf8 modification in hive metadata

Source: Internet
Author: User

When the table or field has Chinese characters, you need to modify the hive metadatabase settings.
Taking MYSQL as an example, when the MySQL character set is set to utf8, hive may be used. For details, see the hive wiki.

Therefore, when hive uses MySQL as the metadatabase, set the MySQL character set to latin1.
To save the utf8 Chinese characters, you need to separately change the character set of the fields stored in MySQL to utf8.

Modify Field annotation Character Set

Alter table columns Modify column comment varchar (256) Character Set utf8;

Modify the table comment character set

Alter table tabl_params Modify column param_value varchar (4000) Character Set utf8;

Do not forget to modify the hive JDBC connection and change the character set to utf8, as shown in figure

Javax. JDO. Option. connectionurljdbc: mysql: // 192.168.0.128: 3306/hive? Characterencoding = UTF-8

 

Transferred from http://www.oratea.net /? P = 654

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.