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