Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Hive script error : script does not exists error

Highlighted

Hive script error : script does not exists error

Contributor

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)

8 REPLIES 8

Re: Hive script error : script does not exists error

change your file name "hive.hive" to to "hive1.hql" and give a try. if still doesn't work just give file fullpath

Re: Hive script error : script does not exists error

Contributor

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)

Re: Hive script error : script does not exists error

Can you please paste the out put of cat /etc/hive/conf.server/hive-log4j.properties

Re: Hive script error : script does not exists error

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"

Re: Hive script error : script does not exists error

Contributor

Hi, I have uploaded both the file structure and the log of the file i have. i don't see the file the path you mentioned.

hive.jpglog4j.txt

Re: Hive script error : script does not exists error

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.

Re: Hive script error : script does not exists error

Cloudera Employee

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.

Re: Hive script error : script does not exists error

Cloudera Employee

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

Hope this helps.

Don't have an account?
Coming from Hortonworks? Activate your account here