1. 在服务器命令行中直接执行sql语句或者sql文件中的内容
有时需要在命令行中直接执行hive sql语句,希望不进入hive模式执行,这时候就可以使用hive -e 或者 hive -f 来实现
1. hive -e 和 hive -f
2. beeline -f ,beeline使用
beeline -u "jdbc:hive2://localhost:10000" -n yourname -p passwore -f hivescript.sql
beeline使用方式请参考:https://www.cnblogs.com/lenmom/p/11218807.html
如果账号链接不上,检查下是不是账号系统ldap服务挂了:systemctl restart slapd
3. 参考链接
https://blog.csdn.net/paulfrank_zhang/article/details/80735633
https://blog.csdn.net/u010002184/article/details/99686311
https://blog.csdn.net/weixin_36630761/article/details/77239451