Dependencies & cluster requirements
Dependencies & cluster requirements
Dependencies:
- ProphecySparkBasicsPython 0.0.1+
- ProphecySparkBasicsScala 0.0.1+
- UC dedicated clusters 14.3+ supported
- UC standard clusters 14.3+ supported
- Livy clusters not supported
- Is an optimized storage layer that allows you to store data and tables in the Databricks lakehouse.
- Extends Parquet data files with a file-based transaction log for ACID transactions and scalable metadata handling.
- Has a tight integration with structured streaming, which allows you to use a single copy of data for both batch and streaming operations and provides incremental processing at scale.
Parameters
Source
The Source gem reads data from Delta files and allows you to optionally specify the following additional properties.Source properties
You can only select
Read Timestamp or Read Version, not both.Example

Compiled code
Without time travel
Timestamp-based time travel
Version-based time travel
Target
The Target gem writes data to Delta files and allows you to optionally specify the following additional properties.Target properties
Supported write modes
Target Example

Compiled code
Delta MERGE
You can upsert data from a sourceDataFrame into a target Delta table by using the MERGE operation. Delta MERGE supports Insert, Update, and Delete operations and modifies records of the most common slowly changing dimension (SCD) cases in one of the following ways:
- SCD1: Delta tables do not retain history.
- SCD2: Delta tables retain history at the row level.
- SCD3: Delta tables retain history at the column level.
SCD1
The following lists the properties in an SCD1 MERGE condition where Delta tables do not retain historical data.Properties
- You must set at least one action out of update, delete or insert.
- A merge operation fails if multiple rows of the source
DataFramematches and the merge attempts to update the same rows of the target Delta table. You can place deduplicate gems before your Target gem if you expect duplicate rows in your Source gem.
Example
Assume you have the following customers table:

Compiled code
SCD2
The following lists the properties in an SCD2 MERGE condition where Delta tables retain history at the row level.Parameters
Example
Continuing from the SCD1 example, you can use the Delta log to capture the historicalcustomer_zip_code at the row-level.
The following shows the output and configurations for an SCD2 merge:
Compiled code
SCD3
Continuing from the SCD2 example, you use the Delta log to capture the historicalcustomer_zip_code at the column-level.
The following shows the output and configurations for an SCD3 merge:
To learn more about how Prophecy uses the Delta file type, see Prophecy with Delta — making data
lakehouses easier.

