hive版本 0.14
desc table_name 或 desc formatted table_name时,comment如果是中文,会显示成乱码。
两种解决办法
1)修改hive源码,重新编译,替换hive-exec-0.14.jar
2)修改Hive MySQL表中,对应的hive table comment 的字段的类型
修改Hive MySQL 元信息表中comment field的编码类型为UTF-8
alter table COLUMNS_V2 modify column comment varchar(256) character set utf8;
COLUMNS_V2 表保存hive表的每一个字段的信息
CD_ID: 每次创建表,都会给表分配一个唯一的ID
COMMENT : 字段的注释
COLUMN_NAME: hive table 字段的名称
TYPE_NAME: hive table field的类型
INTEGER_IDX:字段顺序
修改hive源码,用UTF-8编码
下载hive
https://archive.apache.org/dist/hive/hive-0.14.0/
具体参考