命令行界面CLI

人走茶凉 提交于 2020-03-03 09:43:39

1.hive   -e --执行一个或多个查询

hive -e "select * from student limit 3"

2. hive -e     > 将临时查询保存到文件中

hive -e "select * from student limit 3" > /tmp/myquery  

cat  /tmp/myquery

name1 10

name2 20

3.hive -f +文件名  执行指定文件中的查询

hive -f /path/to/file/withqueries.hsql

cat /path/to/file/withqueries.hsql

select * from student;

4.source --执行脚本

source /path/to/file/withqueries.hsql

5. 执行shell命令 --只要在命令前加上!并且以!结尾

!pwd ;

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!