BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Databricks Exam Databricks-Certified-Professional-Data-Engineer Topic 3 Question 8 Discussion

Actual exam question for Databricks's Databricks-Certified-Professional-Data-Engineer exam
Question #: 8
Topic #: 3
[All Databricks-Certified-Professional-Data-Engineer Questions]

The view updates represents an incremental batch of all newly ingested data to be inserted or updated in the customers table.

The following logic is used to process these records.

MERGE INTO customers

USING (

SELECT updates.customer_id as merge_ey, updates .*

FROM updates

UNION ALL

SELECT NULL as merge_key, updates .*

FROM updates JOIN customers

ON updates.customer_id = customers.customer_id

WHERE customers.current = true AND updates.address <> customers.address

) staged_updates

ON customers.customer_id = mergekey

WHEN MATCHED AND customers. current = true AND customers.address <> staged_updates.address THEN

UPDATE SET current = false, end_date = staged_updates.effective_date

WHEN NOT MATCHED THEN

INSERT (customer_id, address, current, effective_date, end_date)

VALUES (staged_updates.customer_id, staged_updates.address, true, staged_updates.effective_date, null)

Which statement describes this implementation?

Show Suggested Answer Hide Answer

Contribute your Thoughts:

Sheridan
5 months ago
I think I understand now. It's about maintaining history while inserting new values. C makes sense to me.
upvoted 0 times
...
Dick
6 months ago
Yes, I believe so. The logic seems to support that conclusion.
upvoted 0 times
...
Alison
6 months ago
So, would it be correct to say that the answer is C?
upvoted 0 times
...
Sheridan
6 months ago
I agree with User1, it seems like old values are maintained but marked as no longer current.
upvoted 0 times
...
Dick
6 months ago
I think the implementation described is similar to a Type 2 table.
upvoted 0 times
...
Jolene
7 months ago
That logic makes sense because it maintains old values.
upvoted 0 times
...
Veronika
7 months ago
Yeah, I agree with you. It's definitely C.
upvoted 0 times
...
Jolene
7 months ago
I think the correct answer is C.
upvoted 0 times
...

Save Cancel