QuestionQ33

VerifiedDeveloping Code for Data Processing using Python and SQL

A junior data engineer on your team has implemented the following code block.

Question Image

The new_events view contains a batch of records with the same schema as the events Delta table. The event_id field serves as this table’s unique key.

When this query runs, what happens to new records whose event_id matches an existing record?

Explanation

WHEN NOT MATCHED THEN INSERT inserts only source rows that do not match any target row. A record with an existing event_id is matched, and because there is no WHEN MATCHED action, it is left unchanged and the incoming record is ignored.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!