Support Questions

Find answers, ask questions, and share your expertise

Error on Tutorial "How to Process Data with Apache Hive" - Cannot load data into Hive tables

avatar
Contributor

Problem loading data to table in this tutorial

http://hortonworks.com/hadoop-tutorial/how-to-process-data-with-apache-hive/

This command

<code>LOAD DATA INPATH '/user/admin/Batting.csv' OVERWRITE INTO TABLE temp_batting;

produces error

H110 Unable to submit statement. Error while compiling statement: FAILED: HiveAccessControlException Permission denied: user [admin] does not have [READ] privilege on [hdfs://sandbox.hortonworks.com:8020/user/admin/elecMonthly_Orc] [ERROR_STATUS]

I created both user/admin and temp/admin folders. I used hdfs superuser to make admin owner of file, folder, and even parent folder. I gave full permissions in HDFS. and this is clearly shown in Ambari. Error persists.

Can anyone help? Thanks

1 ACCEPTED SOLUTION

avatar
Contributor

It was because when I thought I was creating an elecMonthly_Orc file, actually I created an elecMonthly_Orc folder with several files three files: _SUCCESS, part-r-r-00000-1a0c14e3-0dd0-42db-abc7-7f655a02f634.orc ... and another similar orc files. The files within the elecMonthly_Orc directory were owned by Hive, and that's why the permissions error.

Resolved by using command line as superuser hdfs:

hadoop fs -chown admin:admin /user/admin/elecMonthly_Orc/*.*

Now I just have to figure out how to recombine Orc files in Hive!

View solution in original post

14 REPLIES 14

avatar
@Aidan Condron

Is temp_batting an external or internal table? My assumption is it's an internal table and thus when you load data in path, it's trying to move the data in /apps/warehouse/database(default)/temp_batting and the admin user doesn't have permissions to move the file.

Can you please try running:

hdfs dfs -chmod -R 777 /user/admin/elecMonthly_Orc

and then trying to run your load data inpath command?

avatar
Master Mentor

@Aidan Condron are you still having issues with this? Can you accept best answer or provide your own solution?

avatar
Contributor

It was because when I thought I was creating an elecMonthly_Orc file, actually I created an elecMonthly_Orc folder with several files three files: _SUCCESS, part-r-r-00000-1a0c14e3-0dd0-42db-abc7-7f655a02f634.orc ... and another similar orc files. The files within the elecMonthly_Orc directory were owned by Hive, and that's why the permissions error.

Resolved by using command line as superuser hdfs:

hadoop fs -chown admin:admin /user/admin/elecMonthly_Orc/*.*

Now I just have to figure out how to recombine Orc files in Hive!

avatar
Master Mentor

@Aidan Condron can you convert your response to answer and we can mark it as best answer?

avatar
Rising Star

Hey guys. The tutorial mentioned above has been updated and is also compatible with the latest Sandbox HDP 2.4. It addresses the issue of permissions. Here is the link: http://hortonworks.com/hadoop-tutorial/how-to-process-data-with-apache-hive/

When you a chance, can you go through the tutorial on our new Sandbox?