<?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 Set default database thru Cluster Spark Configuration in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/set-default-database-thru-cluster-spark-configuration/m-p/47645#M5972</link>
    <description>&lt;P&gt;Set the default catalog (AKA default SQL Database) in a Cluster's Spark configuration. I've tried the following :&lt;BR /&gt;&lt;BR /&gt;spark.catalog.setCurrentDatabase("cbp_reporting_gold_preprod") - this works in a Notebook but doesn't do anything in the Cluster.&lt;BR /&gt;&lt;BR /&gt;spark.sql.catalog.spark_catalog.defaultDatabase("cbp_reporting_gold_preprod")&lt;BR /&gt;&lt;BR /&gt;In the Spark config I am entering a slightly different syntax (w/o the parenthesis or quotes). Error logs do not show errors running these commands, but, they simply do not work. I use following command in a notebook to test for this :&lt;BR /&gt;&lt;BR /&gt;spark.catalog.currentDatabase()&lt;BR /&gt;&lt;BR /&gt;The end goal is to set several options in the Cluster so user's can simply query their data using Spark SQL and not be concerned with the database where their tables are located. I've googled extensively for days, have not found a solution yet. Wondering why this works in a notebook&amp;nbsp;spark.catalog.setCurrentDatabase("cbp_reporting_gold_preprod"), but trying this in the Spark Configuration&amp;nbsp;spark.catalog.setCurrentDatabase cbp_reporting_gold_preprod doesn't seem to do anything.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Oct 2023 19:11:09 GMT</pubDate>
    <dc:creator>adrianhernandez</dc:creator>
    <dc:date>2023-10-02T19:11:09Z</dc:date>
    <item>
      <title>Set default database thru Cluster Spark Configuration</title>
      <link>https://community.databricks.com/t5/get-started-discussions/set-default-database-thru-cluster-spark-configuration/m-p/47645#M5972</link>
      <description>&lt;P&gt;Set the default catalog (AKA default SQL Database) in a Cluster's Spark configuration. I've tried the following :&lt;BR /&gt;&lt;BR /&gt;spark.catalog.setCurrentDatabase("cbp_reporting_gold_preprod") - this works in a Notebook but doesn't do anything in the Cluster.&lt;BR /&gt;&lt;BR /&gt;spark.sql.catalog.spark_catalog.defaultDatabase("cbp_reporting_gold_preprod")&lt;BR /&gt;&lt;BR /&gt;In the Spark config I am entering a slightly different syntax (w/o the parenthesis or quotes). Error logs do not show errors running these commands, but, they simply do not work. I use following command in a notebook to test for this :&lt;BR /&gt;&lt;BR /&gt;spark.catalog.currentDatabase()&lt;BR /&gt;&lt;BR /&gt;The end goal is to set several options in the Cluster so user's can simply query their data using Spark SQL and not be concerned with the database where their tables are located. I've googled extensively for days, have not found a solution yet. Wondering why this works in a notebook&amp;nbsp;spark.catalog.setCurrentDatabase("cbp_reporting_gold_preprod"), but trying this in the Spark Configuration&amp;nbsp;spark.catalog.setCurrentDatabase cbp_reporting_gold_preprod doesn't seem to do anything.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 19:11:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/set-default-database-thru-cluster-spark-configuration/m-p/47645#M5972</guid>
      <dc:creator>adrianhernandez</dc:creator>
      <dc:date>2023-10-02T19:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Set default database thru Cluster Spark Configuration</title>
      <link>https://community.databricks.com/t5/get-started-discussions/set-default-database-thru-cluster-spark-configuration/m-p/48616#M5975</link>
      <description>&lt;P&gt;I've tried different commands in the Cluster's Spark Config, none work, they execute at Cluster startup w/o any errors shown in the logs, but once you run a notebook attached to the cluster Default catalog is still set to 'default'.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 17:30:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/set-default-database-thru-cluster-spark-configuration/m-p/48616#M5975</guid>
      <dc:creator>adrianhernandez</dc:creator>
      <dc:date>2023-10-06T17:30:37Z</dc:date>
    </item>
  </channel>
</rss>

