hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anton ashanin <>
Subject Hadoop Hive: How to allow regular user continuously write data and create tables in warehouse directory?
Date Tue, 11 Mar 2014 10:26:27 GMT
I am running Hadoop on a single node.
I am trying to run Java MRD program that writes data to an existing Hive
table from Eclipse under regular user. I get exception: Permission denied:
user=dev, access=WRITE,

This happens because regular user has no write permission to warehouse
directory, only `hdfs` user does:

    drwxr-xr-x   - hdfs hdfs          0 2014-03-06 16:08
    drwxr-xr-x   - hdfs hdfs          0 2014-03-05 12:07

To circumvent this I change permissions on warehouse directory, so
everybody now have write permissions:

    [hdfs@localhost wks]$ hadoop fs -chmod -R a+w /apps/hive/warehouse
    [hdfs@localhost wks]$ hadoop fs -ls /apps/hive/warehouse
    drwxrwxrwx   - hdfs hdfs          0 2014-03-06 16:08
    drwxrwxrwx   - hdfs hdfs          0 2014-03-05 12:07

This helps to some extent, and MRD program can now write as a regular user
to warehouse directory, but only once. When trying to write data into the
same table second time I get:

    ERROR security.UserGroupInformation: PriviledgedActionException as:dev
(auth:SIMPLE) cause:org.apache.hcatalog.common.HCatException : 2003 :
Non-partitioned table already contains data : default.testids

Now, if I delete output table and create it anew in `hive` shell, I again
get default permissions that do not allow regular user to write data into
this table:

    [hdfs@localhost wks]$ hadoop fs -ls /apps/hive/warehouse
    drwxr-xr-x   - hdfs hdfs          0 2014-03-11 12:19
    drwxrwxrwx   - hdfs hdfs          0 2014-03-05 12:07

Please advise on Hive correct configuration steps that will allow a program
run as a regular user do the following operations in Hive warehouse:

- Programmatically create / delete / rename Hive tables?
- Programmatically read / write data from Hive tables?

Many thanks!

View raw message