<?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: Unable to drop a table in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/unable-to-drop-a-table/m-p/19565#M13131</link>
    <description>&lt;P&gt;Use the below code snippet to forcefully drop the table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;package org.apache.spark.sql.hive {
import org.apache.spark.sql.hive.HiveUtils
import org.apache.spark.SparkContext
&amp;nbsp;
object utils {
    def dropTable(sc: SparkContext, dbName: String, tableName: String, ignoreIfNotExists: Boolean, purge: Boolean): Unit = {
      HiveUtils
          .newClientForMetadata(sc.getConf, sc.hadoopConfiguration)
          .dropTable(dbName, tableName, ignoreIfNotExists, false)
    }
  }
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import org.apache.spark.sql.hive.utils
utils.dropTable(sc, "default", "my_table", true, true)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jun 2021 16:19:55 GMT</pubDate>
    <dc:creator>brickster_2018</dc:creator>
    <dc:date>2021-06-25T16:19:55Z</dc:date>
    <item>
      <title>Unable to drop a table</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-drop-a-table/m-p/19564#M13130</link>
      <description>&lt;P&gt;I have a Table which and I do not have access to the underlying data any longer. We do not need this dataset anymore, but unable to drop the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 16:19:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-drop-a-table/m-p/19564#M13130</guid>
      <dc:creator>brickster_2018</dc:creator>
      <dc:date>2021-06-25T16:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to drop a table</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-drop-a-table/m-p/19565#M13131</link>
      <description>&lt;P&gt;Use the below code snippet to forcefully drop the table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;package org.apache.spark.sql.hive {
import org.apache.spark.sql.hive.HiveUtils
import org.apache.spark.SparkContext
&amp;nbsp;
object utils {
    def dropTable(sc: SparkContext, dbName: String, tableName: String, ignoreIfNotExists: Boolean, purge: Boolean): Unit = {
      HiveUtils
          .newClientForMetadata(sc.getConf, sc.hadoopConfiguration)
          .dropTable(dbName, tableName, ignoreIfNotExists, false)
    }
  }
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import org.apache.spark.sql.hive.utils
utils.dropTable(sc, "default", "my_table", true, true)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 16:19:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-drop-a-table/m-p/19565#M13131</guid>
      <dc:creator>brickster_2018</dc:creator>
      <dc:date>2021-06-25T16:19:55Z</dc:date>
    </item>
  </channel>
</rss>

