Practice Exam

Question 56 of 75

Implement Incremental Loading with Merge Update

You work for MDFT Pro, a well-known training agency that tracks student course progress. Mark, a Data Engineer at MDFT Pro, manages a Fabric lakehouse named StudentProgressLakehouse that contains a table named ProgressStatus_Target with the following columns:

The data source system contains a table named ProgressStatus_Source with the same columns, which is used to populate ProgressStatus_Target with incremental updates. In a notebook named ProgressUpdateNotebook, Mark loads ProgressStatus_Source to a DataFrame named sourceDF and ProgressStatus_Target to a DataFrame named targetDF. Mark needs to implement an incremental loading pattern using ProgressUpdateNotebook that will update existing student progress records. The solution must meet the following requirement: For all matching records that have the same value of Key (indicating the same student enrollment), update the value of LastModified in ProgressStatus_Target to reflect the latest timestamp from ProgressStatus_Source.

How should Mark complete the merge statement?

(targetDF
    .merge(sourceDF, "sourceDF.Key = targetDF.Key")
    ._____________ (
        set = {"targetDF.LastModified": "sourceDF.LastModified"}
    )
.execute()
)

Choose the correct answer from the options below.

Explanations for each answer:

Learn more about upserting into Delta Lake tables using merge:
Delta Lake Merge Operations
Next Question
Discuss this question on social media: