hive 创建表中文注释乱码解决

2020-03-17  本文已影响0人  夜空痕

hive 的元数据是db,我设置的是mysql;
而在mysql中,我设置了默认编码是utf8

当hive 创建元数据库时,hive元数据库编码必须是latin1

alter database hive character set latin1;

修改hive元数据库编码为latin1;

然后修改表的编码为utf-8

alter table COLUMNS_V2 modify column COMMENT varchar(256) character set utf8;

mysql> alter table TABLE_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8;

mysql> alter table PARTITION_PARAMS  modify column PARAM_VALUE varchar(4000) character set utf8;


mysql> alter table PARTITION_KEYS  modify column PKEY_COMMENT varchar(4000) character set utf8;

mysql> alter table  INDEX_PARAMS  modify column PARAM_VALUE  varchar(4000) character set utf8;
上一篇下一篇

猜你喜欢

热点阅读