实际查询中
但是我们想查询出来的结果 有对应字段的意义 id , name
然后重新启动hive ,发现多一个(default),它是hive.cli.print.current.db 配置的结果。
hive >select id ,name from db_hive.student; 结果是这样的
11111 lisi
22222 wangwu
33333 zhaoxi11111
但是我们想查询出来的结果 有对应字段的意义 id , name
id name
11111 lisi
22222 wangwu
33333 zhaoxi11111
这里只需要在 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>
然后重新启动hive ,发现多一个(default),它是hive.cli.print.current.db 配置的结果。
再查询时,就可以得到结果,就有对应的字段信息 id , name