[英]Hive SQL file execution
I am using Cloudera Quickview VM 5.10我正在使用 Cloudera Quickview VM 5.10
The following is my implementation which is not working.以下是我的实现,它不起作用。
hive -f /user/hive/warehouse/sample.sql
It says the file not found.它说找不到文件。 If I changed the file location to "/user/cloudera/sample.sql" then also the same issue.
如果我将文件位置更改为“/user/cloudera/sample.sql”,那么也是同样的问题。 If I change the file location to "/home/cloudera/sample.sql" then it is invoking Hive and working as expected.
如果我将文件位置更改为“/home/cloudera/sample.sql”,那么它正在调用 Hive 并按预期工作。
Seems it is a permission issue.似乎是权限问题。 How to solve it?
如何解决? Please help.
请帮忙。
It is not clear which file are you trying to execute: in HDFS or local filesystem.目前尚不清楚您要执行哪个文件:在 HDFS 或本地文件系统中。
hive -f <filename>
command runs local file, not in HDFS. hive -f <filename>
命令运行本地文件,不在 HDFS 中。
Check the file is located on the machine on which you are running hive (use ls -l <path>
)检查文件是否位于运行 hive 的机器上(使用
ls -l <path>
)
If you want to run file located in HDFS , you need to load it to local machine first (using hdfs dfs -get
) or use this command:如果要运行位于 HDFS 中的文件,则需要先将其加载到本地计算机(使用
hdfs dfs -get
)或使用以下命令:
hive -f <(hdfs dfs -cat /path/in_HDFS/sample.sql)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.