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.

Error loading csv file using hive

Solved Go to solution
Highlighted

Re: Error loading csv file using hive

Super Guru

Thanks @Yair Ogen,

1.Please share the output of below command

hadoop fs -ls /apps/hive/

2.Run insert statement again and attach hiveserver2.log

hiveserver2.log
Highlighted

Re: Error loading csv file using hive

Contributor

@Shu

hadoop fs -ls /apps/hive/

Yields

Found 1 items
drwxrwxrwx   - hive hadoop          0 2017-10-02 14:00 /apps/hive/warehouse

You mean the Load statement and not the insert, right?

Attached is the error and last lines from log.


Highlighted

Re: Error loading csv file using hive

Super Mentor

@Yair Ogen

In this case we see that user "hive" is actually trying to write data inside the "" directory

Permission denied: user=hive, access=WRITE, inode="/user/admin/MOCK_DATA.csv":admin:hadoop:drwxr-xr-x

.

So either you should give write access to the "hive" user on the mentioned directory "/user/admin/" As we see that it does not have the "WRITE" permission Or you should run the job using "admin" user with the following setup:

If you want to run as "admin"

# hdfs dfs -chown admin:hadoop /user/admin
# hdfs dfs -chmod 777 /user/admin

.

Or else if you want to run the hive job using "hive" user then you should change the ownership to "hive" user and the permission accordingly.

# hdfs dfs -chown hive:hadoop /user/admin
# hdfs dfs -chmod 777 /user/admin

.

Re: Error loading csv file using hive

Contributor

@Jay SenSharma @Shu

So - now it works. I just connected to the admin user instead of hive user and now it all works fine.

Thanks for you help.

View solution in original post

Highlighted

Re: Error loading csv file using hive

Super Mentor
@Yair Ogen

Good to know that it works now. It will be great if you can mark this HCC Thread as "Accepted" (Answered) so that other HCC users can quickly find the solution for this issue , instead of reading the whole thread.

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