在xshell 中进入文件夹:
vi test.sql
然后将要执行的sql输入,注意开头不能有空格
写完后按Esc键,输入:x保存并退出
输入下面代码:
/usr/bin/beeline -u "jdbc:hive2://dsrv1.heracles.sohuno.com:10000/mbadp;principal=hive/[email protected]" --hiveconf mapreduce.job.queuename=sohumb -f test.sql > test.txt
将结果保存:
sz test.txt