-e ‘quoted query string’: 运行引号内sql查询语句 Sql from command linelinux
-f : 从文件中运行sql语句 Sql from filesql
linux环境下:ide
$hive -e “sql语句” > 1.log 发现执行后会把结果写入1.log中,包括count(*)的结果string
$hive -f 某个文件(里面是sql语句) > 2.log 发现执行后会把结果写入2.log中,包括count(*)的结果it
$hive -f 某个文件(里面是sql语句) 执行文件里的sql,class
hive -f 的某个文件的扩展名能够是.txt .sql .log .hql ,扩展