①在Hive元数据存储的Mysql数据库中,执行以下SQL:
alter table COLUMNS_V2 modify column COMMENT varchar(256) character set utf8;
alter table TABLE_PARAMS modify column PARAM_VALUE varchar(20000) character set utf8;
alter table PARTITION_PARAMS modify column PARAM_VALUE varchar(20000) character set utf8;
alter table PARTITION_KEYS modify column PKEY_COMMENT varchar(20000) character set utf8;
alter table INDEX_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8;
ALTER TABLE TBLS modify COLUMN VIEW_EXPANDED_TEXT mediumtext CHARACTER SET utf8;
ALTER TABLE TBLS modify COLUMN VIEW_ORIGINAL_TEXT mediumtext CHARACTER SET utf8;
②修改hive-site.xml中Hive读取元数据的编码
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://hdp1:3306/metastore?useSSL=false&useUnicode=true&characterEncoding=UTF-8</value>
</property>
|