Capturing Delta Changes in Your Local Table (File)
Enable Delta Capture in your local table (file) to automatically track all inserts, updates, and deletions of its records via Change Date and Change Type columns. You can use replication flows and transformation flows to write to these tables and to read from them, extracting only delta changes for each run.
Prerequisites
-
Your table must have the status Not Deployed.
-
You must define one or more key columns.
Switching Delta Capture On
Local tables (files) can be used as source data or target data by SAP Datasphere apps. For some business scenarios, you might need to keep an eye on changes that will be made after you have deployed your local table (file). For example, after you run a merge task or a transformation flow, you might want to know which data is updated or deleted. When creating a local table (file), you can switch on a toggle that will capture the future updates made in your table.
You enable Delta Capture while creating a local table. See Creating a Local Table (File).
-
Delta Capture Table field is added and a default name for the delta capture table is defined (Technical name + Delta).
-
2 additional columns are automatically created in my table:
Column Description Possible Values Change Date
The column will track the last date and time of the last change to an individual record.
Current UTC timestamp.
Change Type
This column will track the type of last change made to a record.
This column will track the type of last change made to a record.When a record is inserted or updated corresponding change types are used: "I" for insert (a new record is added), "U" for update (an existing record gets an updated value). When an existing record is deleted other specific change types are used (for example "D"). Note that deleting a record will not physically delete it, so that the changes can be propagated to the different objects that consume it in delta mode. It is however filtered out when accessing the Local Table (using the Active Records Table). For more information on records deletion, see Deleting Local Table (File) Records
Log Retention Period and Prompt Processing of Changes
The log retention time in the SAP HANA Data Lake Files storage is 30 days. Checkpoint files that are older than 30 days are automatically cleaned up when a new version is created. Make sure to process data changes in a flow before the required checkpoint files get deleted. As a best practice, we recommend not letting more than 3 days between a merge task and a flow run.
Deployment and Consumption of Local Table (File) With Delta Capture
-
The table that contains the delta capture columns. The technical name ends with "Delta".
-
The table that contains only the active records. It excludes both the delta capture columns and the historical data versions.
-
Most SAP Datasphere apps consume a local table with delta capture through the Active Records table only. In these cases, local tables behave the same way independent of whether Delta Capture is set to "On" or "Off". For examples in Graphical Views, SQL Views, E/R Modeler or Business Builder, or data preview in Table Editor, see Preview and Edit Local Table (File) Data.
-
The following SAP Datasphere apps also interact with the Delta Capture Table that contains the delta columns:
-
Transformation Flow: The delta capture table can be used by both source and target. SeeCreating a Transformation Flow in a File Space
-
Replication Flow: The delta capture table can be used as source or target but with some restrictions, see SAP Datasphere Targets for Replication Flows and SAP Datasphere Local Table (File) Sources for Replication Flows.
-