I have a number of tables (with varying degrees of differences in schemas but with a common set of fields) that I would like to Union and load from bronze -> Silver in an incremental manner. So the goal is to go from multiple tables to a single table using DLT.
Example:
X_Events
Y_Events
.... N_Events
To: All_Events
I am using a for loop to go through all the databases -> tables and then performing a readStream
followed by a UnionByName
.
However, if there is an additional table added/ modified dynamically that I need to process in the next run, I am getting a checkpoint error.
There are [8] sources in the checkpoint offsets and now there are
[6] sources requested by the query. Cannot continue.
Is there a way to address this dynamically?
Should I build my own incremental logic? Is there a better way to achieve this?