<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Hive user cannot read from HDFS on &amp;quot;load data inpath&amp;quot; if hive.server2.enable.doAs=false and HDFS access granted by Ranger in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Hive-user-cannot-read-from-HDFS-on-quot-load-data-inpath/m-p/164308#M126678</link>
    <description>&lt;P&gt;As a workaround, you can create an external table on /user/test1/csvfolder, and then insert records from this table into your internal table using "INSERT INTO TABLE tbl SELECT * FROM tbl_ext; However, creating external table requires write permission on your csvfolder, although the files there will be left intact.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Feb 2017 05:53:25 GMT</pubDate>
    <dc:creator>pminovic</dc:creator>
    <dc:date>2017-02-08T05:53:25Z</dc:date>
    <item>
      <title>Hive user cannot read from HDFS on "load data inpath" if hive.server2.enable.doAs=false and HDFS access granted by Ranger</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-user-cannot-read-from-HDFS-on-quot-load-data-inpath/m-p/164306#M126676</link>
      <description>&lt;P&gt;This is likely a bug.&lt;/P&gt;&lt;P&gt;On our HDP 2.5 clusters, we have:&lt;/P&gt;&lt;P&gt;hive.server2.enable.doAs=false&lt;/P&gt;&lt;P&gt;The HDFS folder /user/test1/csvfolder has read,write,execute permissions granted to the user hive by Ranger&lt;/P&gt;&lt;P&gt;While loading data into an internal Hive table using "load data inpath '/user/test1/csvfolder into table tablename', we get an error.&lt;/P&gt;&lt;P&gt;INFO  : Loading data to table tablename from hdfs://sandbox.hortonworks.com:8020/user/test1/csvfolder
ERROR : Failed with exception org.apache.hadoop.security.AccessControlException: Permission denied. user=hive is not the owner of inode=csvfile.csv
  at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkOwner(FSPermissionChecker.java:250)
  at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:227)
  at org.apache.ranger.authorization.hadoop.RangerHdfsAuthorizer$RangerAccessControlEnforcer.checkPermission(RangerHd  fsAuthorizer.java:307)&lt;/P&gt;&lt;P&gt;This error occurs both using Beeline as well as Hue's hive client.&lt;/P&gt;&lt;P&gt;Here's why I think the error occurs. When doing a 'load data in path', it appears that hive copies the data files from hdfs into /apps/hive/warehouse/database/table/ with the user and owner of the files intact. Once it's copied, Hive then reads the copied files, but does so in a way that bypasses Ranger. So, if the original user and owner of the files copied isn't owned by hive, then the error occurs.&lt;/P&gt;&lt;P&gt;-rw-r--r--  3 test1 users  21226781 2017-02-07 16:27 /apps/hive/warehouse/sample_database.db/tablename/csvfile.csv&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 01:28:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-user-cannot-read-from-HDFS-on-quot-load-data-inpath/m-p/164306#M126676</guid>
      <dc:creator>leon_li</dc:creator>
      <dc:date>2017-02-08T01:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: Hive user cannot read from HDFS on "load data inpath" if hive.server2.enable.doAs=false and HDFS access granted by Ranger</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-user-cannot-read-from-HDFS-on-quot-load-data-inpath/m-p/164307#M126677</link>
      <description>&lt;P&gt;Hi @Leon,&lt;/P&gt;&lt;P&gt;This is a known issue, and Hive engineering is aware and working on it. There is not an Apache Hive JIRA created for this issue yet, but I will update this thread once one has been filed.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;@Darwin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 01:48:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-user-cannot-read-from-HDFS-on-quot-load-data-inpath/m-p/164307#M126677</guid>
      <dc:creator>dtraver</dc:creator>
      <dc:date>2017-02-08T01:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Hive user cannot read from HDFS on "load data inpath" if hive.server2.enable.doAs=false and HDFS access granted by Ranger</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-user-cannot-read-from-HDFS-on-quot-load-data-inpath/m-p/164308#M126678</link>
      <description>&lt;P&gt;As a workaround, you can create an external table on /user/test1/csvfolder, and then insert records from this table into your internal table using "INSERT INTO TABLE tbl SELECT * FROM tbl_ext; However, creating external table requires write permission on your csvfolder, although the files there will be left intact.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 05:53:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-user-cannot-read-from-HDFS-on-quot-load-data-inpath/m-p/164308#M126678</guid>
      <dc:creator>pminovic</dc:creator>
      <dc:date>2017-02-08T05:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Hive user cannot read from HDFS on "load data inpath" if hive.server2.enable.doAs=false and HDFS access granted by Ranger</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-user-cannot-read-from-HDFS-on-quot-load-data-inpath/m-p/164309#M126679</link>
      <description>&lt;P&gt;Same problem here. Is it fixed in HDP 2.6?&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2017 16:55:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-user-cannot-read-from-HDFS-on-quot-load-data-inpath/m-p/164309#M126679</guid>
      <dc:creator>f1sherox</dc:creator>
      <dc:date>2017-10-21T16:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Hive user cannot read from HDFS on "load data inpath" if hive.server2.enable.doAs=false and HDFS access granted by Ranger</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-user-cannot-read-from-HDFS-on-quot-load-data-inpath/m-p/164310#M126680</link>
      <description>&lt;P&gt;Same here with HDP 2.6. The datafolder is owned by HDFS:HDFS. Ranger granted full access to user Hive. And yet when creating external table user hive is denied access.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 03:07:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-user-cannot-read-from-HDFS-on-quot-load-data-inpath/m-p/164310#M126680</guid>
      <dc:creator>ychenma</dc:creator>
      <dc:date>2018-12-07T03:07:04Z</dc:date>
    </item>
  </channel>
</rss>

