码迷,mamicode.com
首页 > 编程语言 > 详细

python操作hive并且获取查询结果scheam

时间:2018-10-18 21:56:36      阅读:537      评论:0      收藏:0      [点我收藏+]

标签:select   strong   use   查询   bsp   title   https   源码   col   

 

执行hive -e 命令并且获取对应的select查询出来的值及其对应的scheam字段

需要在执行语句中前部添加 set hive.cli.print.header=true; 这个设置,如下语句: hive -e "set hive.cli.print.header=true;use default;select * from students"

这样最后的结果中会返回查询出来的字段值及其对应的scheam

 

源码参考地址:https://github.com/xjh713/hive-get-scheam.git

 

python操作hive并且获取查询结果scheam

标签:select   strong   use   查询   bsp   title   https   源码   col   

原文地址:https://www.cnblogs.com/xjh713/p/9813119.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!