You are completing the SQL flow in the exhibit for a Lakeflow pipeline. The source table bronze.customer_changes has the columns customer_id, name, department, region, last_login, operation, and sequence_num.
The source system sends partial update records. Every record includes non-null customer_id, operation, and sequence_num values. Among the name, department, region, and last_login columns, a record supplies values only for changed columns; unchanged columns are null.
The target customers_history must meet these requirements:
- Keep a full history of every change to the name, department, and region columns.
- A change to last_login must update the current row in place without creating a new version.
- Columns that a partial update record leaves null must keep their existing values in the target.
-- Excerpt: additional clauses are still to be added CREATE FLOW customers_history_flow AS AUTO CDC INTO customers_history FROM stream(bronze.customer_changes) KEYS (customer_id) SEQUENCE BY sequence_num COLUMNS * EXCEPT (operation, sequence_num)
Which three clauses should you add to the flow? Each correct answer presents part of the solution.
Requirement 1 needs SCD Type 2, which keeps each earlier version and records when it was active. Requirement 2 needs TRACK HISTORY ON * EXCEPT (last_login), so last_login changes update the current record in place while changes to other columns still create versions. Requirement 3 needs IGNORE NULL UPDATES, because otherwise a partial update record would overwrite unchanged columns with nulls. SCD Type 1 fails the history requirement, and tracking history on last_login fails the in-place update requirement.
- Ingest data into Unity Catalog: Ingest data with CDC feedMicrosoft Learn