title: Connect to Databricks managed Hive from outside
body: <p>I have:</p>
  <ul>
  <li>An existing Databricks cluster
  <ul>
  <li>Azure blob store (wasb) mounted to HDFS</li>
  <li>A Database with its LOCATION set to a path on wasb (via mount path)</li>
  <li>A Delta table (Which ultimately writes Delta-formatted parquet files to blob store path)</li>
  </ul>
  </li>
  <li>A kubernetes cluster
  <ul>
  <li>Reads and writes data in parquet and/or Delta format within the same Azure blob store that Databricks uses (writing as delta format via spark-submit pyspark)</li>
  </ul>
  </li>
  </ul>
  <p>What I want to do:</p>
  <ul>
  <li>Utilize the managed Hive metastore in Databricks to act as data catalog for all data within Azure blob store</li>
  </ul>
  <p>To this end, I'd like to connect to the metastore from my outside pyspark job such that I can use consistent code to have a catalog that accurately represents my data.</p>
  <hr />
  <p>In other words, if I were to prep my db from within Databricks:</p>
  <pre><code>dbutils.fs.mount(
    source = &quot;wasbs://container@storage.blob.core.windows.net&quot;,
    mount_point = &quot;/mnt/db&quot;,
    extra_configs = {..})
  
  spark.sql('CREATE DATABASE db LOCATION &quot;/mnt/db&quot;')
  </code></pre>
  <p>Then from my Kubernetes pyspark cluster, I'd like to execute</p>
  <pre><code>df.write.mode('overwrite').format(&quot;delta&quot;).saveAsTable(&quot;db.table_name&quot;)
  </code></pre>
  <p>Which should write the data to <code>wasbs://container@storage.blob.core.windows.net/db/table_name</code> as well as register this table with Hive (and thus be able to query it with HiveQL)</p>
  <hr />
  <p>How to I connect to the Databricks managed Hive from a pyspark session outside of Databricks environment?</p>