相当一部分人,容易忽略hive脚本,其实,这在生产环境里,是非常重要的!
$ hive -e "show tables"
$ hive -e "show tables " >> aa
$ hive -e "show tables " > aa
$ hive -S -e "show tables" >a
新建hql文件,写入show tables;
$ hive -f hql
$ hive -i hql
可以看出,hive -i比hive -f是,执行完之后,还可以继续操作。
$ source hql;
另,这篇博客,也不错,