hive笔记

1、显示数据库,列名

Apache

<property>
	<name>hive.cli.print.header</name>
	<value>true</value>
</property>

<property>
	<name>hive.cli.print.current.db</name>
	<value>true</value>
</property>

HDP

hive-site中修改为true

custom hive-site中添加一列属性

2、hive中注释乱码

(1)修改表字段注解和表注解

alter table COLUMNS_V2 modify column COMMENT varchar(4000) character set utf8;
alter table TABLE_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8;

(2)修改分区字段注解

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;

(3)修改索引注解

alter table INDEX_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8;

(4)修改metastore数据库连接

apache

hive-site

	<property>
	  <name>javax.jdo.option.ConnectionURL</name>
	  <value>jdbc:mysql://hadoop100:3306/metastore?createDatabaseIfNotExist=true</value>
	  <description>JDBC connect string for a JDBC metastore</description>
	</property>

hdp

注意:要重新创建表

posted @ 2020-07-30 19:02  hyunbar  阅读(117)  评论(0编辑  收藏  举报