You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Zoltán Tóth-Czifra <zo...@softonic.com> on 2012/08/27 18:25:39 UTC

File permissions when creating external table

Hi,

I understand that, to create a new table in Hive with an external data source, you don't need to have write permissions to the files themselves (only the metastore). However, I receive the following error when I try to create the table with only read rights to the files.

DROP TABLE IF EXISTS raw_product_logs;
CREATE EXTERNAL TABLE IF NOT EXISTS  raw_product_logs (
    kcid STRING,
    ip_address STRING,
    partner STRING,
)
STORED AS TEXTFILE
LOCATION '/data/raw/product_logs/*';

FAILED: Error in metadata: MetaException(message:Got exception: org.apache.hadoop.security.AccessControlException org.apache.hadoop.security.AccessControlException: Permission denied: user=product, access=WRITE, inode="/data/raw/product_logs":logsync:hadoop:drwxr-xr-x)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

Is it because Hive "just in case" checks the permissions even if I never intend to manipulate these files via Hive?

I have found this issue which would imply that Hive surely doesn't need permissions for external tabled that are created as "READONLY", however, is doesn't seem to be attended.
https://issues.apache.org/jira/browse/HIVE-335

Is there any workaround for this?

Thanks!

RE: File permissions when creating external table

Posted by Zoltán Tóth-Czifra <zo...@softonic.com>.
Hi,

FYI, my colleagues have found the problem. It's the asterisk in the end of the directory - in case of an external table if should not be there.

Regards,
Zoltan
________________________________
From: Zoltán Tóth-Czifra [zoltan.tothczifra@softonic.com]
Sent: Monday, August 27, 2012 6:25 PM
To: user@hive.apache.org
Subject: File permissions when creating external table

Hi,

I understand that, to create a new table in Hive with an external data source, you don't need to have write permissions to the files themselves (only the metastore). However, I receive the following error when I try to create the table with only read rights to the files.

DROP TABLE IF EXISTS raw_product_logs;
CREATE EXTERNAL TABLE IF NOT EXISTS  raw_product_logs (
    kcid STRING,
    ip_address STRING,
    partner STRING,
)
STORED AS TEXTFILE
LOCATION '/data/raw/product_logs/*';

FAILED: Error in metadata: MetaException(message:Got exception: org.apache.hadoop.security.AccessControlException org.apache.hadoop.security.AccessControlException: Permission denied: user=product, access=WRITE, inode="/data/raw/product_logs":logsync:hadoop:drwxr-xr-x)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

Is it because Hive "just in case" checks the permissions even if I never intend to manipulate these files via Hive?

I have found this issue which would imply that Hive surely doesn't need permissions for external tabled that are created as "READONLY", however, is doesn't seem to be attended.
https://issues.apache.org/jira/browse/HIVE-335

Is there any workaround for this?

Thanks!