I am a newbie to Hive and trying to write a script file which contains 3 queries in it.I have already created the table in /user/hive/warehouse(default database).I am not sure where to save the script file and what command to use to execute it?Looking forward for a solution. Info:I am working on hive-ubuntu. Thanks Sweesha
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
in local FS :
/home/username/some/path/Query1.q (.hql) -- inside it query is "show databases;"
(give all three Queries in one file if needed)
from shell $:
user@hostname $ $HIVE_HOME/bin/hive -f /home/username/some/path/Query1.q
OK
database_name
db
default
financials
mydb
from hive CLi :
hive> source /home/username/some/path/Query1.q