首页 > 技术文章 > Hive执行sql文件

one--way 2017-10-09 10:46 原文

方法1: hive -f sql文件

  t.sql文件内容:

select *from userinfo limit 10;

  执行命令

hive -f t.sql

 

方法2: 进入hive shell, 执行source命令

进入hive 终端

$ hive
hive>

使用source命令执行

hive>source t.sql

 

 

 

  

  

推荐阅读