I am using 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. If I change the file location to "/home/cloudera/sample.sql" then it is invoking Hive and working as expected.
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.
hive -f <filename>
command runs local file, not in HDFS.
Check the file is located on the machine on which you are running hive (use 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:
hive -f <(hdfs dfs -cat /path/in_HDFS/sample.sql)