<?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>topic Re: I cannot see the Hive databases or tables once I terminate the cluster and use another cluster. in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16149#M10361</link>
    <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;can you see the database and tables in the web UI, "Data" in the menu on the left?&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Aug 2021 09:09:29 GMT</pubDate>
    <dc:creator>-werners-</dc:creator>
    <dc:date>2021-08-23T09:09:29Z</dc:date>
    <item>
      <title>I cannot see the Hive databases or tables once I terminate the cluster and use another cluster.</title>
      <link>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16148#M10360</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt; I am using Databricks community edition for learning purposes.&lt;/P&gt;
&lt;P&gt; I created some Hive-managed tables through spark sql as well as with df.saveAsTable options. &lt;/P&gt;&lt;P&gt;&lt;/P&gt; But when I connect to a new cluser, 
&lt;P&gt;&lt;B&gt; "Show databases"&lt;/B&gt;&lt;/P&gt;
&lt;P&gt; only returns the default database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt; The database and tables I created with the previous cluster are not shown.
&lt;P&gt; However when I run&lt;/P&gt;
&lt;P&gt;&lt;B&gt; spark.conf.get("spark.sql.warehouse.dir")&lt;/B&gt;&lt;/P&gt;
&lt;P&gt; it returns &lt;/P&gt;
&lt;P&gt;&lt;B&gt;'/user/hive/warehouse'&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;and When I check the dbfs directory &lt;/P&gt;
&lt;P&gt;&lt;B&gt; %fs ls dbfs:/user/hive/warehouse&lt;/B&gt;&lt;/P&gt;
&lt;P&gt; I see the databases and tables I created in other sessions. Am I missing anything or sparkSQL doesn't read the hive managed tables created in other clusters in commnunity edition?&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Aug 2021 07:05:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16148#M10360</guid>
      <dc:creator>lnsnarayanan</dc:creator>
      <dc:date>2021-08-22T07:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: I cannot see the Hive databases or tables once I terminate the cluster and use another cluster.</title>
      <link>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16149#M10361</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;can you see the database and tables in the web UI, "Data" in the menu on the left?&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 09:09:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16149#M10361</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2021-08-23T09:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: I cannot see the Hive databases or tables once I terminate the cluster and use another cluster.</title>
      <link>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16150#M10362</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I cannot see databases and tables when no cluster is attached and when I attach a new cluster, I see only the &lt;B&gt;default &lt;/B&gt;database.&lt;/P&gt;
&lt;P&gt; But I can see previously created databases and tables using&lt;/P&gt;
&lt;P&gt;%fs ls /user/hive/warehouse command.&lt;/P&gt;
&lt;P&gt;It is not showing up in the data menu or using sparkSQL.&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 09:21:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16150#M10362</guid>
      <dc:creator>lnsnarayanan</dc:creator>
      <dc:date>2021-08-23T09:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: I cannot see the Hive databases or tables once I terminate the cluster and use another cluster.</title>
      <link>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16151#M10363</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Yes, but you mentioned you did thus by using the "show databases" command in a notebook.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;I ask you to check using the Databricks Web UI.&lt;P&gt;&lt;/P&gt;It could be that Community Edition does not have this functionality though. 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 09:38:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16151#M10363</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2021-08-23T09:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: I cannot see the Hive databases or tables once I terminate the cluster and use another cluster.</title>
      <link>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16152#M10364</link>
      <description>&lt;P&gt;I have the same problem, so it's the feather of CE ?&lt;/P&gt;</description>
      <pubDate>Sat, 25 Sep 2021 02:21:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16152#M10364</guid>
      <dc:creator>dududu</dc:creator>
      <dc:date>2021-09-25T02:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: I cannot see the Hive databases or tables once I terminate the cluster and use another cluster.</title>
      <link>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16153#M10365</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, the databases created from one cluster cannot be accessed from another in CE. Even a restart of the same cluster would not show the databases/tables created before the restart. &lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 10:59:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16153#M10365</guid>
      <dc:creator>Srihasa_Akepati</dc:creator>
      <dc:date>2021-10-07T10:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: I cannot see the Hive databases or tables once I terminate the cluster and use another cluster.</title>
      <link>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16154#M10366</link>
      <description>&lt;P&gt;This is a limitation in CE.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 07:04:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/16154#M10366</guid>
      <dc:creator>Prabakar</dc:creator>
      <dc:date>2021-10-12T07:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: I cannot see the Hive databases or tables once I terminate the cluster and use another cluster.</title>
      <link>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/56475#M30566</link>
      <description>&lt;P&gt;This "feature" in the Community edition is based on the fact that I cannot restart a cluster. So, in the morning I create a cluster for studies purposes and in the afternoon I have to recreate the cluster.&lt;/P&gt;&lt;P&gt;If there's any dependent objects from previous labs I have to rerun the Notebooks and recreate them, but before I do it I have to drop all files and directories (tables) I had previously created.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here's a tip if anyone needs:&lt;/STRONG&gt;&lt;BR /&gt;1. List the Database directory (usually it will be &lt;STRONG&gt;dbfs:/user/hive/datawarehouse/&lt;/STRONG&gt;)&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;EM&gt;%sql&lt;/EM&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;EM&gt;DESCRIBE DATABASE default&lt;/EM&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2. Get the files Location from the previous output and list the files&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;EM&gt;f = dbutils.fs.ls('dbfs:/user/hive/warehouse')&lt;/EM&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;EM&gt;display(f)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;3. Remove the files and directories so that you'll be able to rerun your Notebook to recreate the dependent tables to continue your labs.&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;%fs rm -r dbfs:/user/hive/warehouse/&amp;lt;replace_with_a_file_or_directory&amp;gt;/&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Now you're good to go on recreating the tables and views.&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 05 Jan 2024 10:33:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/56475#M30566</guid>
      <dc:creator>dez</dc:creator>
      <dc:date>2024-01-05T10:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: I cannot see the Hive databases or tables once I terminate the cluster and use another cluster.</title>
      <link>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/71515#M34334</link>
      <description>&lt;P&gt;As the file still in the dbfs you can just recreate the reference of your tables and continue the work, with something like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;db_name = "mydb"
from pathlib import Path
path_db = f"dbfs:/user/hive/warehouse/{db_name}.db/"
tables_dirs = dbutils.fs.ls(path_db)
for d in tables_dirs:
  table_name = Path(d.path).name  
  spark.sql(f"""CREATE TABLE IF NOT EXISTS {table_name}
            LOCATION '{d.path}'
            """)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 18:24:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-cannot-see-the-hive-databases-or-tables-once-i-terminate-the/m-p/71515#M34334</guid>
      <dc:creator>dhpaulino</dc:creator>
      <dc:date>2024-06-03T18:24:08Z</dc:date>
    </item>
  </channel>
</rss>

