hive查询如何显示查询的字段
2017-10-01 21:37
204 查看
实际查询中
hive >select id ,name from db_hive.student; 结果是这样的
11111 lisi
22222 wangwu
33333 zhaoxi11111
但是我们想查询出来的结果 有对应字段的意义 id , name
这里只需要在 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
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
相关文章推荐
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- hive查询如何显示查询的字段
- 配置另hive中查询表时同时显示表的字段名
- PP生产订单状态显示(rel等)如何查询表,字段
- 在 sql查询中如何将两个字段显示在一个字段
- 一个表里有多个字段需要同时使用字典表进行关联显示,如何写sql查询语句