hive表字段注释显示乱码问题

创建了一张hive表,对字段增加了注释,比如comment '注释内容' 之类的,但是在hive client查看时候却是乱码

比如:

create table test_ultraedit (
id int comment 'id',
name string comment '名字'
);

在hive client查看:

 因为乱码的注释内容是中文,所以第一感觉应该是hive 元数据库编码的问题,登录mysql修改hive元数据库CLOUMNS_V2表

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

然后再创建创建一张表测试:

create table test_ultraedit2 (
id int comment 'id',
name string comment '名字'
);

到hive client验证:

正常!

原文地址:https://www.cnblogs.com/zz-ksw/p/11889554.html