有沒有辦法讓Hive以列式方式輸出結果,就像MySQL提供的「\ G」選項一樣?像MySQL的「 G」這樣的垂直格式的Hive查詢結果?
http://dev.mysql.com/doc/refman//5.5/en/mysql-commands.html
有沒有辦法讓Hive以列式方式輸出結果,就像MySQL提供的「\ G」選項一樣?像MySQL的「 G」這樣的垂直格式的Hive查詢結果?
http://dev.mysql.com/doc/refman//5.5/en/mysql-commands.html
如果您使用HiveServer2(Hive> 0.14),則可以使用「直線」外殼,並且有「vertical
」選項。
0: jdbc:hive2://127.0.0.1:10000> !set outputformat table
0: jdbc:hive2://127.0.0.1:10000> select * from sample_07 limit 1;
+-----------------+------------------------+----------------------+-------------------+
| sample_07.code | sample_07.description | sample_07.total_emp | sample_07.salary |
+-----------------+------------------------+----------------------+-------------------+
| 00-0000 | All Occupations | 134354250 | 40690 |
+-----------------+------------------------+----------------------+-------------------+
1 row selected (0.131 seconds)
0: jdbc:hive2://127.0.0.1:10000> !set outputformat vertical
0: jdbc:hive2://127.0.0.1:10000> select * from sample_07 limit 1;
sample_07.code 00-0000
sample_07.description All Occupations
sample_07.total_emp 134354250
sample_07.salary 40690
1 row selected (0.063 seconds)
0: jdbc:hive2://127.0.0.1:10000>
沒有出現在蜂房沒有這樣的設施。
map-reduce程序的結果總是按行顯示。
如何,您可以使用Hive/Thrift服務器並通過其他腳本語言(如Python)編寫您的配置單元查詢並控制輸出的顯示。唯一的缺點是你必須解析輸出並顯示它。
什麼是直線外殼。你能不能告訴如何調用它。使用什麼命令。?什麼是兼容的hadoop版本? –