2014-12-11 26 views

回答

0

,如果你有一個查詢文件傳遞的變量作爲hiveconf 蜂巢-hiveconf VAR1 = ABCD -f file.txt的

,或者您可以構建您的查詢,然後將它傳遞使用蜂巢CLI - Ë 蜂巢-e 「創建表...」

0

文件filename.lst

line 

使文件test.sh,

temp=$(cat /home/user/filename.lst) 

hive -f test.hql -hiveconf var=$temp 

做出另一個文件test.hql

create table test(${hiveconf:var} string); 
上終端

sh -x test.sh 

它將線路傳遞給test.hql,它會創建一個錶行作爲列;

注意 - 所有文件應該在同一個目錄中。此腳本僅傳遞一個變量。

相關問題