进入到hive里不知道用的是那个数据库
查询表的时候也不知道表头有哪些字段
这里配置显示当前使用数据库和显示表头有两种方法:
方法一 : 配置文件 hive-site.xml
<property>
<name>hive.cli.print.header</name>
<value>true</value>
<description>Whether to print the names of the columns in query output.</description>
</property>
<property>
<name>hive.cli.print.current.db</name>
<value>true</value>
<description>Whether to include the current database in the Hive prompt.</description>
</property>
方法二:在bin目录下创建隐藏文件.hiverc
ll -a 查看所有文件
用vi命令编辑.hiverc
然后保存退出
之后重启hive当前使用的数据库和表头就都出现了