<?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: Pyspark insertinto on Hive external table doesn't work if overwrite is true in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/pyspark-insertinto-on-hive-external-table-doesn-t-work-if/m-p/7319#M3220</link>
    <description>&lt;P&gt;@ppatel:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using insertInto with overwrite=True on a Hive external table in PySpark, it might not work as expected. This is because Hive external tables are not managed by Hive and the table data is stored externally. When you use overwrite=True, it tries to overwrite the table data, which is not possible as the data is stored outside of Hive. Instead, you can try using insertInto with overwrite=False. This will append the data to the existing data in the external table. If you want to completely replace the data in the external table, you can try deleting the data from the external location and then using &lt;/P&gt;&lt;P&gt;insertInto with overwrite=False to load the new data.&lt;/P&gt;&lt;P&gt;Alternatively, you can create a managed table in Hive and use insertInto with  overwrite=True to overwrite the data in the table. However, this will create a new directory in HDFS and copy the data to that directory, which may not be desirable if you have a large amount of data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 02 Apr 2023 05:23:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-04-02T05:23:57Z</dc:date>
    <item>
      <title>Pyspark insertinto on Hive external table doesn't work if overwrite is true</title>
      <link>https://community.databricks.com/t5/data-engineering/pyspark-insertinto-on-hive-external-table-doesn-t-work-if/m-p/7317#M3218</link>
      <description>&lt;P&gt;Getting an Hive Exception​&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 22:07:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pyspark-insertinto-on-hive-external-table-doesn-t-work-if/m-p/7317#M3218</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-21T22:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Pyspark insertinto on Hive external table doesn't work if overwrite is true</title>
      <link>https://community.databricks.com/t5/data-engineering/pyspark-insertinto-on-hive-external-table-doesn-t-work-if/m-p/7318#M3219</link>
      <description>&lt;P&gt;Can you share the command you used and the exception screenshot please? &lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 08:31:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pyspark-insertinto-on-hive-external-table-doesn-t-work-if/m-p/7318#M3219</guid>
      <dc:creator>pvignesh92</dc:creator>
      <dc:date>2023-03-22T08:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: Pyspark insertinto on Hive external table doesn't work if overwrite is true</title>
      <link>https://community.databricks.com/t5/data-engineering/pyspark-insertinto-on-hive-external-table-doesn-t-work-if/m-p/7319#M3220</link>
      <description>&lt;P&gt;@ppatel:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using insertInto with overwrite=True on a Hive external table in PySpark, it might not work as expected. This is because Hive external tables are not managed by Hive and the table data is stored externally. When you use overwrite=True, it tries to overwrite the table data, which is not possible as the data is stored outside of Hive. Instead, you can try using insertInto with overwrite=False. This will append the data to the existing data in the external table. If you want to completely replace the data in the external table, you can try deleting the data from the external location and then using &lt;/P&gt;&lt;P&gt;insertInto with overwrite=False to load the new data.&lt;/P&gt;&lt;P&gt;Alternatively, you can create a managed table in Hive and use insertInto with  overwrite=True to overwrite the data in the table. However, this will create a new directory in HDFS and copy the data to that directory, which may not be desirable if you have a large amount of data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Apr 2023 05:23:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pyspark-insertinto-on-hive-external-table-doesn-t-work-if/m-p/7319#M3220</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-02T05:23:57Z</dc:date>
    </item>
  </channel>
</rss>

