方法1: hive -f sql文件sql
t.sql文件内容:shell
select *from userinfo limit 10;
执行命令spa
hive -f t.sql
方法2: 进入hive shell, 执行source命令code
进入hive 终端blog
$ hive hive>
使用source命令执行it
hive>source t.sql