Hi Team,
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.
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.
Thank you in advance for your assistance.
See the code below:
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}")
)