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