<?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 managed &amp;amp; external path Question! in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/hive-managed-amp-external-path-Question/m-p/374366#M241960</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/86410"&gt;@novice_tester&lt;/a&gt;&amp;nbsp;Could you please make it a bit clearer for us? What are the DDLs(create table command) you used to create the managed table, and the external table?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Creating a managed table in any location outside of 'hive.metastore.warehouse.dir' path should prompt the following error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;A managed table's location should be located within managed warehouse root directory or within its database's managedLocationUri.&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;/warehouse/tablespace/managed/hive/ seems like the warehouse directory for the external tables. So, I doubt creating the managed table picked this location on its own.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you also share the outputs of the following commands from beeline:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;beeline&amp;gt; set hive.metastore.warehouse.dir;
beeline&amp;gt; hive.metastore.warehouse.external.dir;&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;An external table can be created with the LOCATION clause, and we can set any path w/ it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Refer to this Cloudera &lt;A href="https://docs.cloudera.com/cdp-private-cloud-base/7.1.7/using-hiveql/topics/hive-table-location.html" target="_blank" rel="noopener"&gt;Doc&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jul 2023 17:22:49 GMT</pubDate>
    <dc:creator>smruti</dc:creator>
    <dc:date>2023-07-24T17:22:49Z</dc:date>
    <item>
      <title>hive managed &amp; external path Question!</title>
      <link>https://community.cloudera.com/t5/Support-Questions/hive-managed-amp-external-path-Question/m-p/374266#M241924</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I created a managed table called "questiuon".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, a path called "/warehouse/tablespace/external/hive/question.db" was created on the hdfs path.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Conversely, creating an external table also creates a path called "/warehouse/tablespace/managed/hive/question.db".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the reason?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 06:30:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/hive-managed-amp-external-path-Question/m-p/374266#M241924</guid>
      <dc:creator>novice_tester</dc:creator>
      <dc:date>2023-07-21T06:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: hive managed &amp; external path Question!</title>
      <link>https://community.cloudera.com/t5/Support-Questions/hive-managed-amp-external-path-Question/m-p/374366#M241960</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/86410"&gt;@novice_tester&lt;/a&gt;&amp;nbsp;Could you please make it a bit clearer for us? What are the DDLs(create table command) you used to create the managed table, and the external table?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Creating a managed table in any location outside of 'hive.metastore.warehouse.dir' path should prompt the following error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;A managed table's location should be located within managed warehouse root directory or within its database's managedLocationUri.&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;/warehouse/tablespace/managed/hive/ seems like the warehouse directory for the external tables. So, I doubt creating the managed table picked this location on its own.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you also share the outputs of the following commands from beeline:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;beeline&amp;gt; set hive.metastore.warehouse.dir;
beeline&amp;gt; hive.metastore.warehouse.external.dir;&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;An external table can be created with the LOCATION clause, and we can set any path w/ it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Refer to this Cloudera &lt;A href="https://docs.cloudera.com/cdp-private-cloud-base/7.1.7/using-hiveql/topics/hive-table-location.html" target="_blank" rel="noopener"&gt;Doc&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 17:22:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/hive-managed-amp-external-path-Question/m-p/374366#M241960</guid>
      <dc:creator>smruti</dc:creator>
      <dc:date>2023-07-24T17:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: hive managed &amp; external path Question!</title>
      <link>https://community.cloudera.com/t5/Support-Questions/hive-managed-amp-external-path-Question/m-p/374404#M241976</link>
      <description>&lt;P&gt;&lt;SPAN&gt;DDL Statement:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CREATE DATABASE QUESTION;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are no special set options or settings that have been touched.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Totally default!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 06:31:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/hive-managed-amp-external-path-Question/m-p/374404#M241976</guid>
      <dc:creator>novice_tester</dc:creator>
      <dc:date>2023-07-25T06:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: hive managed &amp; external path Question!</title>
      <link>https://community.cloudera.com/t5/Support-Questions/hive-managed-amp-external-path-Question/m-p/374454#M241984</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/86410"&gt;@novice_tester&lt;/a&gt;&amp;nbsp;when you create a database, it takes the external warehouse directory path from&amp;nbsp;&lt;EM&gt;hive.metastore.warehouse.external.dir,&amp;nbsp;&lt;/EM&gt;and sets that as the database &lt;STRONG&gt;LOCATION&amp;nbsp;&lt;/STRONG&gt;for external tables only(when created without setting location clause). Please note, there is another &lt;STRONG&gt;MANAGEDLOCATION&lt;/STRONG&gt; field that is blank.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;describe database extended question;

+-----------+----------+----------------------------------------------------+------------------+-------------+-------------+-------------+
|  db_name  | comment  |                      location                      | managedlocation  | owner_name  | owner_type  | parameters  |
+-----------+----------+----------------------------------------------------+------------------+-------------+-------------+-------------+
| question  |          | hdfs://node2.cloudera.com:8020/warehouse/tablespace/external/hive/question.db |                  | hive        | USER        |             |
+-----------+----------+----------------------------------------------------+------------------+-------------+-------------+-------------+&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;A &lt;STRONG&gt;Managedlocation&lt;/STRONG&gt; can be set on a database if you want to use a different location for managed tables other than&amp;nbsp;&lt;EM&gt;hive.metastore.warehouse.dir. &lt;/EM&gt;Otherwise it is kept blank. I hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To summarize, you do not need to worry about the LOCATION of a database. It can host both managed and external tables. When you create a managed table under the same DB, it will pick the path set in&amp;nbsp;hive.metastore.warehouse.dir, irrespective of the database Location, and when you create an external table without the location clause, it gets stored in the DB LOCATION path.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 14:29:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/hive-managed-amp-external-path-Question/m-p/374454#M241984</guid>
      <dc:creator>smruti</dc:creator>
      <dc:date>2023-07-25T14:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: hive managed &amp; external path Question!</title>
      <link>https://community.cloudera.com/t5/Support-Questions/hive-managed-amp-external-path-Question/m-p/374469#M241991</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/86410"&gt;@novice_tester&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. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 20:00:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/hive-managed-amp-external-path-Question/m-p/374469#M241991</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2023-07-25T20:00:24Z</dc:date>
    </item>
  </channel>
</rss>

