Alvin Lee
02/28/2024, 5:51 PMDaily Partitions
. So this ingestion happens on a daily schedule.
But then, my DB can be updating data older than 1 days old, and I would like to be able to detect this change and backfill the affected partitions. I do have the logic to detect these changes.
I think this could be do-able with a sensor, but I have quite a number of tables, so it doesn't sound practical to create 1 sensor each. Also, I ingest these tables together in a single job daily. To ensure code maintainability, I don't think I want to add a check logic for each table inside the sensor, each time I add a new table. Ideally, I'm looking for a clean solution to handle this. Clean in a way that if I add a new table to the job, I do not need to touch this update sensor.
For example, is there a way for me to iterate through all the assets in the job from the @sensor decorated function? And then retrieve details (that I can choose) about each of these assets programmatically?
Apart from sensor, I see that there is such thing as an observable asset
. I could not find much literature about using it but I thought it might be a potential solution. Like if I were to declare my external tables as an observable asset each, do I implement the logic to check for changes in that function? If so, how do I then trigger backfill of affects partitions from there?
For me now, the easiest solution right now is to backfill each partition for a few days, but I don't think it is foolproof. Any suggestions is welcomed.Jon Erik Kemi Warghed
02/28/2024, 8:36 PMAlvin Lee
02/29/2024, 12:14 AMAlvin Lee
02/29/2024, 12:36 AMJon Erik Kemi Warghed
02/29/2024, 6:36 AMJon Erik Kemi Warghed
02/29/2024, 6:38 AMAlvin Lee
02/29/2024, 6:41 AMAlvin Lee
02/29/2024, 6:41 AMJon Erik Kemi Warghed
02/29/2024, 12:15 PMJon Erik Kemi Warghed
02/29/2024, 12:16 PMAlvin Lee
02/29/2024, 12:26 PMJon Erik Kemi Warghed
02/29/2024, 1:04 PM