<?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 Delta adds a new partition making the old partition unreadable in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/delta-adds-a-new-partition-making-the-old-partition-unreadable/m-p/19356#M12959</link>
    <description>&lt;P&gt;&amp;nbsp; In Notebook, My code read and write the data to delta , My delta is partitioned by calendar_date. After the initial load i am able to read the delta file and look the data just fine.But after the second load for data for 6 month , the previous partitons are not loading normally using delta format.Reading my source delta file like this throws me error saying file dosen't exist.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    spark.read.format("delta").load("/mnt/kgaurav/table /calendar_date=2018-10-04/")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However reading like below just works fine any idea what could be wrong&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;spark.conf.set("spark.databricks.delta.formatCheck.enabled", "false")
&amp;nbsp;
    spark.read.format("parquet").load("/mnt/kgaurav/table/calendar_date=2018-&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jun 2021 17:21:21 GMT</pubDate>
    <dc:creator>User16826994223</dc:creator>
    <dc:date>2021-06-25T17:21:21Z</dc:date>
    <item>
      <title>Delta adds a new partition making the old partition unreadable</title>
      <link>https://community.databricks.com/t5/data-engineering/delta-adds-a-new-partition-making-the-old-partition-unreadable/m-p/19356#M12959</link>
      <description>&lt;P&gt;&amp;nbsp; In Notebook, My code read and write the data to delta , My delta is partitioned by calendar_date. After the initial load i am able to read the delta file and look the data just fine.But after the second load for data for 6 month , the previous partitons are not loading normally using delta format.Reading my source delta file like this throws me error saying file dosen't exist.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    spark.read.format("delta").load("/mnt/kgaurav/table /calendar_date=2018-10-04/")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However reading like below just works fine any idea what could be wrong&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;spark.conf.set("spark.databricks.delta.formatCheck.enabled", "false")
&amp;nbsp;
    spark.read.format("parquet").load("/mnt/kgaurav/table/calendar_date=2018-&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 17:21:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/delta-adds-a-new-partition-making-the-old-partition-unreadable/m-p/19356#M12959</guid>
      <dc:creator>User16826994223</dc:creator>
      <dc:date>2021-06-25T17:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Delta adds a new partition making the old partition unreadable</title>
      <link>https://community.databricks.com/t5/data-engineering/delta-adds-a-new-partition-making-the-old-partition-unreadable/m-p/19357#M12960</link>
      <description>&lt;P&gt;I think you are writing the data in override mode. what happens in delta is  it  doesn't delete the data for certain days  even it is  written by overwrite mode for versioning , and you will be able to query only most recent data,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in format parquet if you are reading you are using  deleted file also that is why  you are able to get the data.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;v = spark.sql(f"DESCRIBE HISTORY delta.`{path}` limit 2")
version = v.take(2)[1][0]
df = spark.read.format("delta").option("versionAsOf", version).load(path)
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 17:21:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/delta-adds-a-new-partition-making-the-old-partition-unreadable/m-p/19357#M12960</guid>
      <dc:creator>User16826994223</dc:creator>
      <dc:date>2021-06-25T17:21:53Z</dc:date>
    </item>
  </channel>
</rss>

