<?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: Avoiding Duplicate Ingestion with Autoloader and Migrated S3 Data in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/avoiding-duplicate-ingestion-with-autoloader-and-migrated-s3/m-p/62633#M32020</link>
    <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/101621"&gt;@Olaoye_Somide&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing the source means that Autoloader discovers the files as a new (technically - they are on a new location, so they are new indeed).&lt;/P&gt;&lt;P&gt;To overcome the issue you can use modifiedAfter property&lt;/P&gt;</description>
    <pubDate>Tue, 05 Mar 2024 10:00:56 GMT</pubDate>
    <dc:creator>daniel_sahal</dc:creator>
    <dc:date>2024-03-05T10:00:56Z</dc:date>
    <item>
      <title>Avoiding Duplicate Ingestion with Autoloader and Migrated S3 Data</title>
      <link>https://community.databricks.com/t5/data-engineering/avoiding-duplicate-ingestion-with-autoloader-and-migrated-s3/m-p/62574#M32003</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;We recently migrated event files from our previous S3 bucket to a new one. While utilizing Autoloader for batch ingestion, we've encountered an issue where the migrated data is being processed as new events. This leads to duplicate records in our Databricks Delta table.&lt;/P&gt;&lt;P&gt;While we understand Autoloader utilizes RocksDB for deduplication, we'd appreciate your insights on how to effectively ensure Autoloader ignores or skips events previously ingested from the old S3 bucket.&lt;/P&gt;&lt;P&gt;Thank you in advance for your assistance.&lt;/P&gt;&lt;P&gt;See the code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;spark.conf.set("spark.databricks.cloudFiles.checkSourceChanged", False)

(
    spark.readStream.format("cloudFiles")
    .option("cloudFiles.format", "json")
    .option("cloudFiles.schemaLocation", schema_path)
    .option("cloudFiles.schemaEvolutionMode", "addNewColumns")
    .load(f"s3://{bucket_name}/{bucket_prefix}")
    .writeStream.option("checkpointLocation", checkpoint_path)
    .option("mergeSchema", "true")
    .trigger(availableNow=True)
    .toTable(f"{catalog_name}.{schema_name}.{delta_table_name}")
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 11:21:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/avoiding-duplicate-ingestion-with-autoloader-and-migrated-s3/m-p/62574#M32003</guid>
      <dc:creator>Olaoye_Somide</dc:creator>
      <dc:date>2024-03-04T11:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Duplicate Ingestion with Autoloader and Migrated S3 Data</title>
      <link>https://community.databricks.com/t5/data-engineering/avoiding-duplicate-ingestion-with-autoloader-and-migrated-s3/m-p/62633#M32020</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/101621"&gt;@Olaoye_Somide&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing the source means that Autoloader discovers the files as a new (technically - they are on a new location, so they are new indeed).&lt;/P&gt;&lt;P&gt;To overcome the issue you can use modifiedAfter property&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 10:00:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/avoiding-duplicate-ingestion-with-autoloader-and-migrated-s3/m-p/62633#M32020</guid>
      <dc:creator>daniel_sahal</dc:creator>
      <dc:date>2024-03-05T10:00:56Z</dc:date>
    </item>
  </channel>
</rss>

