(Glue-2405) Data Replication with Delta
There is an option to extract data from the source to target using delta load. Delta specifies how data is extracted from source to target. Currently, the delta functionality is supported only for the extraction from the SAP system to storage. More information can be found in the chapter Delta Mechanisms.
To successfully execute delta loads we need to create the SAP Table Fetcher. SAP Table Fetcher provides multiple delta types: TRIGGER, DATE, TMSTMP, VALUE, VALUE_DIST. More information can be found in the chapter Manage Delta.
If we are executing the extraction process using delta, there are three load types we can choose from:
Delta Init Without Data
Delta Init + Full Load
Delta Load
All following examples are using TRIGGER delta.
Delta Init Without Data
This load type initializes the delta pointer and performs no load. This is useful for scenarios, where we do not want to transport all data or the data were already transported earlier and now we just want to initialize delta.
For example, if we have a source table with 4 records that we do not want to transport, we will initialize delta without data, see pictures below.
Based on the logs we can see that 0 records were imported into the target table regardless that some data are present in the source table. Now we will add 5 new records to the source table and execute Delta Load.
Based on the logs we can see that only the 5 new records were imported into the target table. And if we look into the target table we can see that only records with IDs 5,6,7,8,9 were imported. Delta metadata has also been updated so that we do not import the same records again.
Delta Init + Full Load
This load type performs a full load and initializes the delta pointer. All data is transported from source to target and the delta is initialized. This scenario is useful if we want to initialize delta but also transport all data currently present in the source table.
For example, if we have a source table with 3 records and we execute Delta Init + Full Load all 3 records will be transported to the target, and the delta will be initialized, see pictures below.
Based on the logs we can see that 3 records were imported into the target table. Now we add 5 new records into the source table and execute Delta Load.
Based on the logs we can see that only 5 new records, which we added were transported to the target. If we look into the target table we can see that all the records are present. Delta was also updated so we do not import the same records again.