<?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: Error in CREATE table with dbexecute in r in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Error-in-CREATE-table-with-dbexecute-in-r/m-p/329997#M230571</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/83471"&gt;@RafaelDiaz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for using Cloudera Community. Based on the Post, Create Table via Hue works yet fails in R with "dbExecute" Function. While I haven't tried using&amp;nbsp;"dbExecute" Function in R, the Error shows&amp;nbsp;HiveAccessControlException denying the User on "default/iris".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You haven't stated the CDH/CDP Version being used yet I assume your Team is using CDP with Ranger. First, Kindly check if passing the DB Name "cld_ml_bi_eng" with Table Name "iris" in&amp;nbsp;"dbExecute" Function works. Since I haven't used&amp;nbsp;"dbExecute" Function in R, Let us know if passing DB Name with Table Name like &amp;lt;DBName.TableName&amp;gt; is feasible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Secondly, Kindly check in Ranger for the Privilege of User "RDIAZ" for "CREATE" Privilege. Try including the DB Scope to "*" &amp;amp; Confirm the Table being Created with the Database ("default" or "cld_ml_bi_eng"). Accordingly, We can proceed further.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly review &amp;amp; share the Outcome from the above 2 suggestion. If your Team have Fixed the Issue already, We would appreciate your Team sharing the details for fellow Community Users as well. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards, Smarak&lt;/P&gt;</description>
    <pubDate>Thu, 11 Nov 2021 05:38:59 GMT</pubDate>
    <dc:creator>smdas</dc:creator>
    <dc:date>2021-11-11T05:38:59Z</dc:date>
    <item>
      <title>Error in CREATE table with dbexecute in r</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Error-in-CREATE-table-with-dbexecute-in-r/m-p/329988#M230567</link>
      <description>&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;I am trying to create a table using the CREATE TABLE statement, in hue it works perfectly but when I use the dbexecute function in r, I get an error.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;How could it be solved.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HUE.png" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/32853i68E82F7A829D037C/image-size/large?v=v2&amp;amp;px=999" role="button" title="HUE.png" alt="HUE.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;library(DBI)
library(odbc)
con_Hive &amp;lt;- dbConnect(odbc::odbc(), "Hive_produccion", database = "cld_ml_bi_eng", encoding = "latin1")
con_Hive
dbExecute(conn = con_Hive, statement = "CREATE EXTERNAL TABLE iris(sepal_length double,
                           sepal_width double,
                           petal_length double,
                           petal_width double,
                           species varchar(10))
LOCATION '/sandbox/CLD_ML_BI_ENG/iris'")

Error: nanodbc/nanodbc.cpp:1655: 42000: [Cloudera][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: Error while compiling statement: FAILED: HiveAccessControlException Permission denied: user [RDIAZ] does not have [CREATE] privilege on [default/iris] 
&amp;lt;SQL&amp;gt; 'CREATE EXTERNAL TABLE iris(sepal_length double,
                           sepal_width double,
                           petal_length double,
                           petal_width double,
                           species varchar(10))
LOCATION '/sandbox/CLD_ML_BI_ENG/iris'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 08:03:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Error-in-CREATE-table-with-dbexecute-in-r/m-p/329988#M230567</guid>
      <dc:creator>RafaelDiaz</dc:creator>
      <dc:date>2026-04-21T08:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Error in CREATE table with dbexecute in r</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Error-in-CREATE-table-with-dbexecute-in-r/m-p/329997#M230571</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/83471"&gt;@RafaelDiaz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for using Cloudera Community. Based on the Post, Create Table via Hue works yet fails in R with "dbExecute" Function. While I haven't tried using&amp;nbsp;"dbExecute" Function in R, the Error shows&amp;nbsp;HiveAccessControlException denying the User on "default/iris".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You haven't stated the CDH/CDP Version being used yet I assume your Team is using CDP with Ranger. First, Kindly check if passing the DB Name "cld_ml_bi_eng" with Table Name "iris" in&amp;nbsp;"dbExecute" Function works. Since I haven't used&amp;nbsp;"dbExecute" Function in R, Let us know if passing DB Name with Table Name like &amp;lt;DBName.TableName&amp;gt; is feasible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Secondly, Kindly check in Ranger for the Privilege of User "RDIAZ" for "CREATE" Privilege. Try including the DB Scope to "*" &amp;amp; Confirm the Table being Created with the Database ("default" or "cld_ml_bi_eng"). Accordingly, We can proceed further.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly review &amp;amp; share the Outcome from the above 2 suggestion. If your Team have Fixed the Issue already, We would appreciate your Team sharing the details for fellow Community Users as well. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards, Smarak&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 05:38:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Error-in-CREATE-table-with-dbexecute-in-r/m-p/329997#M230571</guid>
      <dc:creator>smdas</dc:creator>
      <dc:date>2021-11-11T05:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Error in CREATE table with dbexecute in r</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Error-in-CREATE-table-with-dbexecute-in-r/m-p/330190#M230614</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/83471"&gt;@RafaelDiaz&lt;/a&gt;,&amp;nbsp;Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 05:03:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Error-in-CREATE-table-with-dbexecute-in-r/m-p/330190#M230614</guid>
      <dc:creator>VidyaSargur</dc:creator>
      <dc:date>2021-11-15T05:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Error in CREATE table with dbexecute in r</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Error-in-CREATE-table-with-dbexecute-in-r/m-p/331372#M230874</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/83471"&gt;@RafaelDiaz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We hope the Post was helpful for you &amp;amp; marking the same as Resolved. If your Team continue to face the issue with HiveAccessControlException, Do update the Post &amp;amp; we can check accordingly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards, Smarak&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 08:46:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Error-in-CREATE-table-with-dbexecute-in-r/m-p/331372#M230874</guid>
      <dc:creator>smdas</dc:creator>
      <dc:date>2021-12-01T08:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Error in CREATE table with dbexecute in r</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Error-in-CREATE-table-with-dbexecute-in-r/m-p/331975#M231038</link>
      <description>&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;It is already solved, it was only missing in the CREATE TABLE to add the sandbox path&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CLD_ML_BI_ENG.iris&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;dbExecute(conn = con_Hive,
statement = "CREATE EXTERNAL TABLE CLD_ML_BI_ENG.iris(sepal_length double, sepal_width double, petal_length double, petal_width double, species varchar(10))
ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION '/sandbox/CLD_ML_BI_ENG/iris'")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:14:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Error-in-CREATE-table-with-dbexecute-in-r/m-p/331975#M231038</guid>
      <dc:creator>RafaelDiaz</dc:creator>
      <dc:date>2021-12-10T22:14:07Z</dc:date>
    </item>
  </channel>
</rss>

