建立表的時候,comment說明字段包含中文,表成功建立以後,中文說明顯示亂碼java
create external table movie( userID int comment '用戶ID', movieID int comment '電影ID', rating int comment '電影評分', timestamped bigint comment '評分時間戳', movieName string comment '電影名字', movieType string comment '電影類型', sex string comment '性別', age int comment '年齡', occupation string comment '職業', zipcode string comment '郵政編碼' ) comment '影評三表合一' row format delimited fields terminated by "," location '/hive/movie';
alter table COLUMNS_V2 modify column COMMENT varchar(256) 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';
<configuration> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://localhost:3306/hivedb?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF-8</value> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>root</value> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>Root123456+</value> </property> </configuration>
drop table movie;