<?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: Databricks Error Inquiry: org.apache.spark.SparkException: Unable to fetch tables of db default in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Databricks-Error-Inquiry-org-apache-spark-SparkException/m-p/373844#M241766</link>
    <description>&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jul 2023 19:02:41 GMT</pubDate>
    <dc:creator>JN_000</dc:creator>
    <dc:date>2023-07-12T19:02:41Z</dc:date>
    <item>
      <title>Databricks Error Inquiry: org.apache.spark.SparkException: Unable to fetch tables of db default</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Databricks-Error-Inquiry-org-apache-spark-SparkException/m-p/373825#M241761</link>
      <description>&lt;P&gt;Hello. I am trying to run explorative Pyspark code within a Databricks ApacheSpark environs. I am pretty sure this syntax is correct, but the subject-referenced apache.spark error keeps throwing. Any insights, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;databaseName = "database"&lt;BR /&gt;desiredColumn = "variable"&lt;BR /&gt;database = spark.sql(f"show tables in {databaseName} ").collect()&lt;BR /&gt;display(database)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tablenames = []&lt;BR /&gt;for row in database:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;cols = spark.table(row.tableName).columns&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; listColumns= spark.table(row.tableName).columns&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if desiredColumn in listColumns:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tablenames.append(row.tableName)&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 16:31:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Databricks-Error-Inquiry-org-apache-spark-SparkException/m-p/373825#M241761</guid>
      <dc:creator>JN_000</dc:creator>
      <dc:date>2023-07-12T16:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Error Inquiry: org.apache.spark.SparkException: Unable to fetch tables of db default</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Databricks-Error-Inquiry-org-apache-spark-SparkException/m-p/373842#M241764</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105965"&gt;@JN_000&lt;/a&gt;&amp;nbsp;Welcome to the Cloudera Community!&lt;BR /&gt;&lt;BR /&gt;To help you get the best possible solution, I have tagged our Spark expert&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/22324"&gt;@Bharati&lt;/a&gt;&amp;nbsp; who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please keep us updated on your post, and we hope you find a satisfactory solution to your query.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 18:40:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Databricks-Error-Inquiry-org-apache-spark-SparkException/m-p/373842#M241764</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2023-07-12T18:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Error Inquiry: org.apache.spark.SparkException: Unable to fetch tables of db default</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Databricks-Error-Inquiry-org-apache-spark-SparkException/m-p/373844#M241766</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 19:02:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Databricks-Error-Inquiry-org-apache-spark-SparkException/m-p/373844#M241766</guid>
      <dc:creator>JN_000</dc:creator>
      <dc:date>2023-07-12T19:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Error Inquiry: org.apache.spark.SparkException: Unable to fetch tables of db default</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Databricks-Error-Inquiry-org-apache-spark-SparkException/m-p/374198#M241902</link>
      <description>&lt;P&gt;&lt;SPAN&gt;We verified the same in the CDP environment, as we are uncertain about the Databricks Spark environment.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;As we have mixed of managed and external tables , extracted the necessary information through HWC.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;gt;&amp;gt;&amp;gt; database=spark.sql("show tables in default").collect()
23/07/20 10:04:45 INFO rule.HWCSwitchRule: Registering Listeners
23/07/20 10:04:47 WARN conf.HiveConf: HiveConf of name hive.masking.algo does not exist
Hive Session ID = e6f70006-0c2e-4237-9a9e-e1d19901af54
&amp;gt;&amp;gt;&amp;gt; desiredColumn="name"
&amp;gt;&amp;gt;&amp;gt; tablenames = []
&amp;gt;&amp;gt;&amp;gt; for row in database:
...  cols = spark.table(row.tableName).columns
...  listColumns= spark.table(row.tableName).columns
...  if desiredColumn in listColumns:
...   tablenames.append(row.tableName)
...
&amp;gt;&amp;gt;&amp;gt;
&amp;gt;&amp;gt;&amp;gt; print("\n".join(tablenames))
movies
tv_series_abc
cdp1
tv_series
spark_array_string_example
&amp;gt;&amp;gt;&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 10:10:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Databricks-Error-Inquiry-org-apache-spark-SparkException/m-p/374198#M241902</guid>
      <dc:creator>ggangadharan</dc:creator>
      <dc:date>2023-07-20T10:10:27Z</dc:date>
    </item>
  </channel>
</rss>

