在使用comment语法创建中文注释后,使用desc查看表结构时,发现中文的注释竟然变成了乱码
查阅多篇文章后得知是因为hive的元数据存放在MySQL中,切换到MySQL中分别输入
alter table COLUMNS_V2 modify column COMMENT varchar(256) character set utf8;
alter table COLUMNS_V2 modify column COLUMN_NAME varchar(128) character set utf8:
alter table TABLE_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8;
alter table PARTITION_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8
alter table PARTITION_KEYS modify column PKEY_COMMENT varchar(4000) character set utf8;
alter table INDEX_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8;
再次查看即可解决