- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ03-29-2023 11:59 PM
Hi,
I am running batch job which processes incoming files. I am trying to limit number of files in each batch process so added maxFilesPerTrigger option. But its not working. It processes all incoming files at once.
(spark.readStream.format("delta").load(silver_path)
.writeStream
.option("checkpointLocation", gold_checkpoint_path)
.option("maxFilesPerTrigger", 200)
.trigger(once=True)
.foreachBatch(foreachBatchFunction)
.start()
.awaitTermination()
)
Please suggest.
Regards,
Sanjay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ03-30-2023 07:02 AM
@Sanjay Jainโ , inside your gold_checkpoint_path, there are a few subfolders.
Go to "commits" and check which is the latest file inside (You can see files named 1,2,3,4,.....50,51 so on. File named with the highest number is the latest one. Assume it is 60 for example. This means micro batch 60 is committed. If no batch is committed yet, you will see no files).
And then check for files inside "offsets" folder. see the latest one in that folder too. That will in almost all cases you will see a file with name = latest batchID found in commits + 1 (61 as per this example. If there were no files at all inside commits, then you will see a file named "0" inside this folder.). And If you see this behavior, take a backup of this latest file and then delete it. Then restart the job. This should help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ03-30-2023 07:51 AM
This seems to be manual step, Is there any way I can this automatically like reprocess the file if any updates are made on that particular file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ03-30-2023 07:54 AM
that sounds more like the change data feed functionality of delta lake.
https://learn.microsoft.com/en-us/azure/databricks/delta/delta-change-data-feed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ03-31-2023 07:08 PM
Hi @Sanjay Jainโ
Hope everything is going great.
Just wanted to check in if you were able to resolve your issue. If yes, would you be happy to mark an answer as best so that other members can find the solution more quickly? If not, please tell us so we can help you.
Cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ04-03-2023 12:04 AM
Hi Vidula,
Above solutions are not working. Please suggest any other solution.
Regards,
Sanjay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ04-03-2023 03:46 AM
@Sanjay Jainโ sorry missed one thing. .trigger(once=True)โ doesn't support rate limiters. You can use .trigger(availableNow=True)โ instead.
spark.readStream.format("delta")
.option("maxFilesPerTrigger", 200)
.load(silver_path)
.writeStream
.option("checkpointLocation", gold_checkpoint_path)
.trigger(availableNow=True)
.foreachBatch(foreachBatchFunction)
.start()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ11-24-2024 10:50 PM
Hi @Sandeep ,
Can we use
spark.readStream.format("delta")
.option("
.load(silver_path)
.writeStream
.option("checkpointLocation", gold_checkpoint_path)
.trigger(availableNow=True)
.foreachBatch(foreachBatchFunction)
.start()


- ยซ Previous
-
- 1
- 2
- Next ยป