hive查询如何显示查询的字段
2017-10-01 21:37
218 查看
实际查询中
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查询如何显示查询的字段
- 如何在sql/plus中把select语句查询显示出来的结果中的显示字段长度缩小
- 在 sql查询中如何将两个字段显示在一个字段
- 在使用Hibernate时,因为一个查询需要更多的表连接而要使用SQL来解决性能问题。然而返回的结果集中包含了没有映射的Entity类中的表字段,在这个SQL中还有使用如何将层次关系的父子结点显示为横行
- PP生产订单状态显示(rel等)如何查询表,字段