In databases, Change Data Capture (CDC) refers to a set of software design patterns used to determine and track the data that has changed so that action can be taken using the changed data. While there are many online implementations available, in this post, I’ll cover a Pyspark based implementation of Slowly Changing Dimension (type-4) where the underlying data is stored in Hive tables (Snapshot + History tables) and in Parquet format. Overview The main objective of this process is to compare incoming data with the existing data, and identify records in the the below mentioned fashion and then write them into history and snapshot tables. Row Operations: | Record Type | row_opern | | ----------- | --------- | | No Change | N | | Updated | U | | Inserted | I | | Deleted | D | Overall process is explained with the help of a flow diagram below: Process Flow Implementation The implementation is based on the below mentioned basic princi...