如何在Hive中编写脚本文件? [英] How to write a script file in Hive?
问题描述
我是Hive的新手,并试图编写一个包含3个查询的脚本文件。我已经在/ user / hive / warehouse(默认数据库)中创建了表。我不确定在哪里保存脚本文件和用什么命令来执行它?期待一个解决方案。
信息:我正在开发hive-ubuntu。
Thanks
Sweesha
在本地FS中
/home/username/some/path/Query1.q(.hql) - 其中的查询是show databases;
(如果需要,将所有三个查询放在一个文件中)
user @ hostname $ $ HIVE_HOME / bin / hive -f /home/username/some/path/Query1.q
OK
database_name
db
默认
财务
mydb
从配置单元CLi开始:
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
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
这篇关于如何在Hive中编写脚本文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!