1. Modify the metadata related information stored in hive in mysql
a. Modify the field comment character set
alter table COLUMNS_V2 modify columnCOMMENT varchar(256) character set utf8;
b. Modify the table comment character set
alter table TABLE_PARAMS modifycolumn PARAM_VALUE varchar(4000) character set utf8;
c. Modify the partition table parameters to support the partition key can be expressed in Chinese
alter table PARTITION_PARAMS modifycolumn PARAM_VALUE varchar(4000) character set utf8;
alter table PARTITION_KEYS modifycolumn PKEY_COMMENT varchar(4000) character set utf8;
d. Modify index annotations
alter table INDEX_PARAMS modifycolumn PARAM_VALUE varchar(4000) character set utf8;
- Modify hive-site.xml
vi hive-site.xml
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://IP:3306/hive?useSSL=false&createDatabaseIfNotExist=true&characterEncoding=UTF-8</value>
</property>
- Rebuild the table structure