-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 ,擴展