Created 04-01-2016 07:59 PM
I am getting following error even though I have the script located at the location.
[hive@ip-hive]$ pwd
/home/ec2-user/scripts/hive
[hive@ip-hive]$ ls -lrt
total 8
-rwxrwxrwx. 1 root root 13 Apr 1 15:50 hive1.sql
-rwxrwxrwx. 1 root root 17 Apr 1 15:53 hive.hive
[hive@ip-hive]$ hive -f /home/ec2-user/scripts/hive/hive1.sql
WARNING: Use "yarn jar" to launch YARN applications. Logging initialized using configuration in file:/etc/hive/2.3.4.0-3485/0/hive-log4j.properties Could not open input file for reading. (File file:/home/ec2-user/scripts/hive/hive1.sql does not exist)
Created 04-01-2016 08:05 PM
change your file name "hive.hive" to to "hive1.hql" and give a try. if still doesn't work just give file fullpath
Created 04-01-2016 08:13 PM
sorry, it was a typo. Please find below I tries with full path. I have updated the question as well
[hive@ip-hive]$ ls -lrt
total 8
-rwxrwxrwx. 1 root root 13 Apr 1 15:50 hive1.sql
-rwxrwxrwx. 1 root root 17 Apr 1 15:53 hive.hive
[hive@ip-hive]$ hive -f /home/ec2-user/scripts/hive/hive1.sql
WARNING: Use "yarn jar" to launch YARN applications. Logging initialized using configuration in file:/etc/hive/2.3.4.0-3485/0/hive-log4j.properties Could not open input file for reading. (File file:/home/ec2-user/scripts/hive/hive1.sql does not exist)
Created 04-01-2016 08:22 PM
Can you please paste the out put of cat /etc/hive/conf.server/hive-log4j.properties
Created 04-01-2016 08:29 PM
you should get similar to like below
[123@123 ~]$ hive -f sample.sql
WARNING: Use "yarn jar" to launch YARN applications. 16/04/01 20:22:26 WARN conf.HiveConf: HiveConf of name hive.semantic.analyzer.factory.impl does not exist 16/04/01 20:22:26 WARN conf.HiveConf: HiveConf of name hive.file.io.read.all.columns does not exist Logging initialized using configuration in file:/etc/hive/conf.server/hive-log4j.properties
But you are getting /etc/hive/2.3.4.0-3485/0/hive-log4j.properties.
I think you need to copy the /etc/hive/conf.server/hive-log4j.properties file to /etc/hive/2.3.4.0-3485/0/hive-log4j.properties or need to check why you are getting Version Number"2.3.4.0-3485"
Created 04-01-2016 08:51 PM
Created 04-02-2016 05:02 AM
Hi @Amit Sharma, something might be wrong with your ACL permissions: You are running Hive as hive user from ec2-user's home directory, and scripts are owned by root. Can you sort that out, first as root:
chown -R ec2-user:ec2-user /home/ec2-user # Replace the group if needed: "ec2-user:group"
and then try to run your Hive command as ec2-user.
Created 07-19-2018 05:33 AM
Hi @Amit Sharma Not sure if this is still a problem. But you might want to check the folder permissions of ec2-user and scripts. Depending on the user that runs the command ensure they have write access to the folder.
Created 07-21-2018 11:31 PM
Please see this article as this might be a way to resolve your problem.
https://community.hortonworks.com/articles/206771/hive-filepathtohiveddlsql-does-not-exist.html